Example #1
0
    def __init__(self, path, revision):
        """
        @type   path: string
        @param  path: The path to open
        
        @type   revision: string
        @param  revision: The revision of the file to open
        
        """
        
        InterfaceNonView.__init__(self)

        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        if revision and type(revision) in (str, unicode):
            revision_obj = self.svn.revision("number", number=revision)
        else:
            revision_obj = self.svn.revision("HEAD")

        url = path
        if not self.svn.is_path_repository_url(path):
            url = self.svn.get_repo_root_url(path) + '/' + path
        dest = "/tmp/rabbitvcs-" + revision + "-" + os.path.basename(path)
        
        self.svn.export(
            url,
            dest,
            revision=revision_obj
        )
        
        rabbitvcs.util.helper.open_item(dest)

        raise SystemExit()
Example #2
0
    def __init__(self, path, pattern, glob=False):
        """
        @type   path: string
        @param  path: The path to apply the ignore keyword to

        @type   pattern: string
        @param  pattern: Ignore items with the given pattern

        @type   glob: boolean
        @param  glob: True if the path to ignore is a wildcard "glob"

        """

        InterfaceNonView.__init__(self)
        self.path = path
        self.pattern = pattern
        self.glob = glob
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        prop = self.svn.PROPERTIES["ignore"]

        self.svn.propset(self.path, prop, self.pattern, recurse=self.glob)

        raise SystemExit()
Example #3
0
    def __init__(self, path, revision):
        """
        @type   path: string
        @param  path: The path to open

        @type   revision: string
        @param  revision: The revision of the file to open

        """

        InterfaceNonView.__init__(self)

        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        if revision and type(revision) in (str, six.text_type):
            revision_obj = self.svn.revision("number", number=revision)
        else:
            revision_obj = self.svn.revision("HEAD")

        url = path
        if not self.svn.is_path_repository_url(path):
            url = self.svn.get_repo_root_url(path) + '/' + path
        dest = helper.get_tmp_path("rabbitvcs-" + revision + "-" +
                                   os.path.basename(path))

        self.svn.export(url, dest, revision=revision_obj, force=True)

        helper.open_item(dest)

        raise SystemExit()
Example #4
0
    def __init__(self, path, pattern, glob=False):
        """
        @type   path: string
        @param  path: The path to apply the ignore keyword to
        
        @type   pattern: string
        @param  pattern: Ignore items with the given pattern
        
        @type   glob: boolean
        @param  glob: True if the path to ignore is a wildcard "glob"
        
        """

        InterfaceNonView.__init__(self)
        self.path = path
        self.pattern = pattern
        self.glob = glob
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()

        prop = self.svn.PROPERTIES["ignore"]

        self.svn.propset(self.path, prop, self.pattern, recurse=self.glob)

        raise SystemExit()
Example #5
0
    def __init__(self, path, revision):
        """
        @type   path: string
        @param  path: The path to open

        @type   revision: string
        @param  revision: The revision of the file to open

        """

        InterfaceNonView.__init__(self)

        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)

        if revision:
            revision_obj = self.git.revision(revision)
        else:
            revision_obj = self.git.revision("HEAD")

        dest_dir = helper.get_tmp_path("rabbitvcs-" + helper.to_text(revision))

        self.git.export(path, dest_dir, revision=revision_obj)

        repo_path = self.git.find_repository_path(path)
        relative_path = path
        if path.startswith(repo_path):
            relative_path = path[len(repo_path) + 1:]

        dest_path = "%s/%s" % (dest_dir, relative_path)

        helper.open_item(dest_path)

        raise SystemExit()
Example #6
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)
        self.register_gtk_quit()

        self.vcs = rabbitvcs.vcs.VCS()

        self.path = path
        
        if not os.path.exists(self.path):
            MessageBox(_("The requested file or folder does not exist."))
            self.close()
            return
        
        dialog = OneLineTextChange(_("Rename"), _("New Name:"), self.path)
        (result, new_path) = dialog.run()

        if result != gtk.RESPONSE_OK:
            self.close()
            return
       
        if not new_path:
            MessageBox(_("The new name field is required"))
        
        self.new_path = new_path
        self.DO_RENAME = True
Example #7
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)
        self.register_gtk_quit()

        self.vcs = rabbitvcs.vcs.VCS()

        self.path = path

        if not os.path.exists(self.path):
            MessageBox(_("The requested file or folder does not exist."))
            sys.exit(-1)
            return

        dialog = OneLineTextChange(_("Rename"), _("New Name:"), self.path)

        label2 = dialog.get_widget("label2")
        orgtext = dialog.get_widget("org_text")

        orgtext.set_text(self.path)

        label2.set_property("visible", True)
        orgtext.set_property("visible", True)

        (result, new_path) = dialog.run()

        if result != Gtk.ResponseType.OK:
            sys.exit(-1)
            return

        if not new_path:
            MessageBox(_("The new name field is required"))

        self.new_path = new_path
        self.DO_RENAME = True
Example #8
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)
        self.register_gtk_quit()

        self.vcs = rabbitvcs.vcs.VCS()

        self.path = path

        if not os.path.exists(self.path):
            MessageBox(_("The requested file or folder does not exist."))
            self.close()
            return

        dialog = OneLineTextChange(_("Rename"), _("New Name:"), self.path)
        (result, new_path) = dialog.run()

        if result != Gtk.ResponseType.OK:
            self.close()
            return

        if not new_path:
            MessageBox(_("The new name field is required"))

        self.new_path = new_path
        self.DO_RENAME = True
Example #9
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)

        rabbitvcs.util.helper.launch_merge_tool(self.path)
        
        self.close()
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)

        rabbitvcs.util.helper.launch_merge_tool(self.path)
        
        self.close()
Example #11
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        log.debug("incoming path: %s"%path)
        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()
        
        status = self.svn.status(self.path)
        if status.simple_content_status() != rabbitvcs.vcs.status.status_complicated:
            log.debug("The specified file is not conflicted.  There is nothing to do.")
            self.close()
            return
        
        filename = os.path.basename(path)
        
        dialog = rabbitvcs.ui.dialog.ConflictDecision(filename)
        action = dialog.run()
        dialog.destroy()
        
        if action == -1:
            #Cancel
            pass
            
        elif action == 0:
            #Accept Mine
            working = self.get_working_path(path)
            shutil.copyfile(working, path)
            self.svn.resolve(path)
                
        elif action == 1:
            #Accept Theirs
            ancestor, theirs = self.get_revisioned_paths(path)
            shutil.copyfile(theirs, path)
            self.svn.resolve(path)
                
        elif action == 2:
            #Merge Manually
            
            working = self.get_working_path(path)
            ancestor, theirs = self.get_revisioned_paths(path)
            
            log.debug("launching merge tool with base: %s, mine: %s, theirs: %s, merged: %s"%(ancestor, working, theirs, path))
            rabbitvcs.util.helper.launch_merge_tool(base=ancestor, mine=working, theirs=theirs, merged=path)

            dialog = rabbitvcs.ui.dialog.MarkResolvedPrompt()
            mark_resolved = dialog.run()
            dialog.destroy()

            if mark_resolved == 1:
                self.svn.resolve(path)

        self.close()
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        log.debug("incoming path: %s"%path)
        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()
        
        status = self.svn.status(self.path)
        if status.simple_content_status() != rabbitvcs.vcs.status.status_complicated:
            log.debug("The specified file is not conflicted.  There is nothing to do.")
            self.close()
            return
        
        filename = os.path.basename(path)
        
        dialog = rabbitvcs.ui.dialog.ConflictDecision(filename)
        action = dialog.run()
        dialog.destroy()
        
        if action == -1:
            #Cancel
            pass
            
        elif action == 0:
            #Accept Mine
            working = self.get_working_path(path)
            shutil.copyfile(working, path)
            self.svn.resolve(path)
                
        elif action == 1:
            #Accept Theirs
            ancestor, theirs = self.get_revisioned_paths(path)
            shutil.copyfile(theirs, path)
            self.svn.resolve(path)
                
        elif action == 2:
            #Merge Manually
            
            working = self.get_working_path(path)
            ancestor, theirs = self.get_revisioned_paths(path)
            
            log.debug("launching merge tool with base: %s, mine: %s, theirs: %s, merged: %s"%(ancestor, working, theirs, path))
            rabbitvcs.util.helper.launch_merge_tool(base=ancestor, mine=working, theirs=theirs, merged=path)

            dialog = rabbitvcs.ui.dialog.MarkResolvedPrompt()
            mark_resolved = dialog.run()
            dialog.destroy()

            if mark_resolved == 1:
                self.svn.resolve(path)

        self.close()
Example #13
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()
        
        status = self.svn.status(self.path)
        if status.simple_content_status() != rabbitvcs.vcs.status.status_complicated:
            log.debug("The specified file is not conflicted.  There is nothing to do.")
            self.close()
            return
        
        filename = os.path.basename(path)
        
        dialog = rabbitvcs.ui.dialog.ConflictDecision(filename)
        (action, mark_resolved) = dialog.run()
        dialog.destroy()
        
        if action == -1:
            #Cancel
            pass
            
        elif action == 0:
            #Accept Mine
            working = self.get_working_path(path)
            shutil.copyfile(working, path)

            if mark_resolved:
                self.svn.resolve(path)
                
        elif action == 1:
            #Accept Theirs
            head = self.get_head_path(path)
            shutil.copyfile(head, path)

            if mark_resolved:
                self.svn.resolve(path)
                
        elif action == 2:
            #Merge Manually
            
            head = self.get_head_path(path)
            working = self.get_working_path(path)
            shutil.copyfile(working, path)
            
            rabbitvcs.util.helper.launch_merge_tool(path, head)

            if mark_resolved:
                self.svn.resolve(path)

        self.close()
    def __init__(self, path):
        InterfaceNonView.__init__(self)

        self.path = path
        self.vcs = rabbitvcs.vcs.VCS()
        self.svn = self.vcs.svn()
        
        status = self.svn.status(self.path)
        if status.simple_content_status() != rabbitvcs.vcs.status.status_complicated:
            log.debug("The specified file is not conflicted.  There is nothing to do.")
            self.close()
            return
        
        filename = os.path.basename(path)
        
        dialog = rabbitvcs.ui.dialog.ConflictDecision(filename)
        (action, mark_resolved) = dialog.run()
        dialog.destroy()
        
        if action == -1:
            #Cancel
            pass
            
        elif action == 0:
            #Accept Mine
            working = self.get_working_path(path)
            shutil.copyfile(working, path)

            if mark_resolved:
                self.svn.resolve(path)
                
        elif action == 1:
            #Accept Theirs
            head = self.get_head_path(path)
            shutil.copyfile(head, path)

            if mark_resolved:
                self.svn.resolve(path)
                
        elif action == 2:
            #Merge Manually
            
            head = self.get_head_path(path)
            working = self.get_working_path(path)
            shutil.copyfile(working, path)
            
            rabbitvcs.util.helper.launch_merge_tool(path, head)

            if mark_resolved:
                self.svn.resolve(path)

        self.close()
Example #15
0
    def __init__(self, path1, revision1=None, path2=None, revision2=None, sidebyside=False):
        InterfaceNonView.__init__(self)

        self.vcs = rabbitvcs.vcs.VCS()

        self.path1 = path1
        self.path2 = path2
        self.sidebyside = sidebyside

        self.temp_dir = tempfile.mkdtemp(prefix=TEMP_DIR_PREFIX)

        if path2 is None:
            self.path2 = path1
Example #16
0
    def __init__(self, path1, revision1=None, path2=None, revision2=None, 
            sidebyside=False):
        InterfaceNonView.__init__(self)
        
        self.vcs = rabbitvcs.vcs.VCS()

        self.path1 = path1
        self.path2 = path2
        self.sidebyside = sidebyside

        self.temp_dir = tempfile.mkdtemp(prefix=TEMP_DIR_PREFIX)

        if path2 is None:
            self.path2 = path1
        
        self.dialog = None
Example #17
0
    def __init__(self, path, revision):
        """
        @type   path: string
        @param  path: The path to open
        
        @type   revision: string
        @param  revision: The revision of the file to open
        
        """
        
        InterfaceNonView.__init__(self)

        self.vcs = rabbitvcs.vcs.VCS()
        self.git = self.vcs.git(path)

        if revision:
            revision_obj = self.git.revision(revision)
        else:
            revision_obj = self.git.revision("HEAD")

        dest_dir = "/tmp/rabbitvcs-" + unicode(revision)
        
        self.git.export(
            path,
            dest_dir,
            revision=revision_obj
        )
        
        repo_path = self.git.find_repository_path(path)
        relative_path = path
        if path.startswith(repo_path):
            relative_path = path[len(repo_path)+1:]
        
        dest_path = "%s/%s" % (dest_dir, relative_path)
        
        rabbitvcs.util.helper.open_item(dest_path)

        raise SystemExit()
Example #18
0
 def __init__(self, path):
     InterfaceNonView.__init__(self)
     self.path = path
     self.vcs = rabbitvcs.vcs.VCS()
     self.svn = self.vcs.svn()
Example #19
0
 def __init__(self, paths):
     InterfaceNonView.__init__(self)
     self.paths = paths
     self.vcs = rabbitvcs.vcs.VCS()
     self.common = rabbitvcs.util.helper.get_common_directory(paths)
Example #20
0
 def __init__(self, paths):
     InterfaceNonView.__init__(self)
     self.paths = paths
     self.vcs = rabbitvcs.vcs.VCS()
Example #21
0
 def __init__(self, path):
     InterfaceNonView.__init__(self)
     self.path = path
     self.vcs = rabbitvcs.vcs.VCS()
     self.svn = self.vcs.svn()
Example #22
0
 def __init__(self, paths):
     InterfaceNonView.__init__(self)
     self.paths = paths
     self.vcs = rabbitvcs.vcs.VCS()
     self.common = rabbitvcs.util.helper.get_common_directory(paths)
Example #23
0
 def __init__(self, paths):
     InterfaceNonView.__init__(self)
     self.paths = paths
     self.vcs = rabbitvcs.vcs.VCS()