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) 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 choose_patch_path(self): path = "" dialog = gtk.FileChooserDialog(_("Create Patch"), None, gtk.FILE_CHOOSER_ACTION_SAVE, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_OK)) dialog.set_do_overwrite_confirmation(True) dialog.set_default_response(gtk.RESPONSE_OK) dialog.set_current_folder_uri( get_common_directory(self.paths).replace("file://", "")) response = dialog.run() if response == gtk.RESPONSE_OK: path = dialog.get_filename() dialog.destroy() return path
def choose_patch_path(self): path = "" dialog = Gtk.FileChooserDialog(title=_("Create Patch"), parent=None, action=Gtk.FileChooserAction.SAVE) dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL) dialog.add_button(_("_Create"), Gtk.ResponseType.OK) dialog.set_do_overwrite_confirmation(True) dialog.set_default_response(Gtk.ResponseType.OK) dialog.set_current_folder_uri( helper.get_common_directory(self.paths).replace("file://", "")) response = dialog.run() if response == Gtk.ResponseType.OK: path = dialog.get_filename() dialog.destroy() return path
def choose_patch_path(self): path = "" dialog = gtk.FileChooserDialog( _("Create Patch"), None, gtk.FILE_CHOOSER_ACTION_SAVE,(gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_SAVE, gtk.RESPONSE_OK)) dialog.set_do_overwrite_confirmation(True) dialog.set_default_response(gtk.RESPONSE_OK) dialog.set_current_folder_uri( get_common_directory(self.paths).replace("file://", "") ) response = dialog.run() if response == gtk.RESPONSE_OK: path = dialog.get_filename() dialog.destroy() return path
def choose_patch_path(self): path = "" dialog = Gtk.FileChooserDialog( title = _("Create Patch"), parent = None, action = Gtk.FileChooserAction.SAVE) dialog.add_button(_("_Cancel"), Gtk.ResponseType.CANCEL) dialog.add_button(_("_Create"), Gtk.ResponseType.OK) dialog.set_do_overwrite_confirmation(True) dialog.set_default_response(Gtk.ResponseType.OK) dialog.set_current_folder_uri( helper.get_common_directory(self.paths).replace("file://", "") ) response = dialog.run() if response == Gtk.ResponseType.OK: path = dialog.get_filename() dialog.destroy() return path