Beispiel #1
0
    def __init__(self, path):
        InterfaceNonView.__init__(self)

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

        helper.launch_merge_tool(self.path)

        self.close()
Beispiel #2
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))
            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()