def editCurrentFile(self): ctx = self.ctx if isinstance(ctx, patchctx): paths = [ctx._path] else: paths = self.getSelectedFiles() qtlib.editfiles(self.repo, paths, parent=self)
def _openineditor(repo, path, rev, line=None, pattern=None, parent=None): """Open editor to show the specified file [unicode]""" path = hglib.fromunicode(path) pattern = hglib.fromunicode(pattern) base = visdiff.snapshot(repo, [path], repo[rev])[0] files = [os.path.join(base, path)] qtlib.editfiles(repo, files, line, pattern, parent=self)
def editSelected(self, path, rev, line): """Open editor to show the specified file""" path = hglib.fromunicode(path) base = visdiff.snapshot(self.repo, [path], self.repo[rev])[0] files = [os.path.join(base, path)] pattern = hglib.fromunicode(self._lastSearch[0]) qtlib.editfiles(self.repo, files, line, pattern, self)
def _editFileAt(self, fds, ctx): repo = self._repoAgentFor(fds[0]).rawRepo() filenames = _lcanonpaths(fds) base, _ = visdiff.snapshot(repo, filenames, ctx) files = [os.path.join(base, filename) for filename in filenames] qtlib.editfiles(repo, files, parent=self.parent())
def editfile(self): if self.path is None: return if self.rev is None: qtlib.editfiles(self._repo, [hglib.fromunicode(self.path)], parent=self) else: base, _ = visdiff.snapshot(self._repo, [hglib.fromunicode(self.path)], self._repo[self.rev]) files = [os.path.join(base, hglib.fromunicode(self.path))] qtlib.editfiles(self._repo, files, parent=self)
def onRowDoubleClicked(self, index): 'tree view emitted a doubleClicked signal, index guarunteed valid' path, status, mst, u, ext, sz = self.tv.model().getRow(index) if status in 'MAR!': self.actions.allactions[0].trigger() elif status == 'S': self.linkActivated.emit( u'subrepo:' + hglib.tounicode(self.repo.wjoin(path))) elif status in 'C?': qtlib.editfiles(self.repo, [path])
def editfile(self): repo, filenames, rev = self._findsub(self._selectedfiles) if not filenames: return if rev is None: qtlib.editfiles(repo, filenames, parent=self.parent()) else: base, _ = visdiff.snapshot(repo, filenames, repo[rev]) files = [os.path.join(base, filename) for filename in filenames] qtlib.editfiles(repo, files, parent=self.parent())
def onRowDoubleClicked(self, index): 'tree view emitted a doubleClicked signal, index guarunteed valid' path, status, mst, u, ext, sz = self.tv.model().getRow(index) if status in 'MAR!': self.actions.allactions[0].trigger() elif status == 'S': self.linkActivated.emit(u'repo:' + hglib.tounicode(self.repo.wjoin(path))) elif status in 'C?': qtlib.editfiles(self.repo, [path])
def onViewFileAtRevision(self): rev = self.selection[0] filenames = [self.filerevmodel.graph.filename(rev)] if not filenames: return if rev is None: qtlib.editfiles(self.repo, filenames, parent=self) else: base, _ = visdiff.snapshot(self.repo, filenames, self.repo[rev]) files = [os.path.join(base, filename) for filename in filenames] qtlib.editfiles(self.repo, files, parent=self)
def editfile(self): filenames = self.filelist.getSelectedFiles() if not filenames: return rev = self.ctx.rev() if rev is None: qtlib.editfiles(self.repo, filenames, parent=self) else: base, _ = visdiff.snapshot(self.repo, filenames, self.ctx) files = [os.path.join(base, filename) for filename in filenames] qtlib.editfiles(self.repo, files, parent=self)
def editLocalFile(self, fds): repo = self._repoAgentFor(fds[0]).rawRepo() filenames = _lcanonpaths(fds) qtlib.editfiles(repo, filenames, parent=self.parent())
def editlocal(self): filenames = self.filelist.getSelectedFiles() if not filenames: return qtlib.editfiles(self.repo, filenames, parent=self)
def onEditLocal(self): filenames = [self.filename] if not filenames: return qtlib.editfiles(self.repo, filenames, parent=self)
def edit(parent, ui, repo, files, lineno=None, search=None): qtlib.editfiles(repo, files, lineno, search, parent)
def edit(self): paths = self.getSelectedPaths(self.rtree) if paths: abspaths = [os.path.join(r, w) for r, w in paths] qtlib.editfiles(self.repo, abspaths, parent=self)
def editlocal(self): repo, filenames, _rev = self._findsub(self._selectedfiles) if not filenames: return qtlib.editfiles(repo, filenames, parent=self.parent())
def edit(self): paths = self.getSelectedPaths(self.rtree) if paths: abspaths = [os.path.join(r,w) for r,w in paths] qtlib.editfiles(self.repo, abspaths, parent=self)
def editlocal(self): if self.path is None: return qtlib.editfiles(self._repo, [hglib.fromunicode(self.path)], parent=self)
def onUnrevDoubleClicked(self, index): file = hglib.fromunicode(self.unrevlist.model().data(index).toString()) qtlib.editfiles(self.repo, [file])