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()
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()
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
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) 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 __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
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()
def __init__(self, path): InterfaceNonView.__init__(self) self.path = path self.vcs = rabbitvcs.vcs.VCS() self.svn = self.vcs.svn()
def __init__(self, paths): InterfaceNonView.__init__(self) self.paths = paths self.vcs = rabbitvcs.vcs.VCS() self.common = rabbitvcs.util.helper.get_common_directory(paths)
def __init__(self, paths): InterfaceNonView.__init__(self) self.paths = paths self.vcs = rabbitvcs.vcs.VCS()
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()