예제 #1
0
 def editCurrentFile(self):
     ctx = self.ctx
     if isinstance(ctx, patchctx):
         paths = [ctx._path]
     else:
         paths = self.getSelectedFiles()
     qtlib.editfiles(self.repo, paths, parent=self)
예제 #2
0
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)
예제 #3
0
 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)
예제 #4
0
 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())
예제 #5
0
 def editCurrentFile(self):
     ctx = self.ctx
     if isinstance(ctx, patchctx):
         paths = [ctx._path]
     else:
         paths = self.getSelectedFiles()
     qtlib.editfiles(self.repo, paths, parent=self)
예제 #6
0
 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)
예제 #7
0
 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)
예제 #8
0
 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])
예제 #9
0
 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())
예제 #10
0
 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])
예제 #11
0
 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)
예제 #12
0
 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())
예제 #13
0
 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)
예제 #14
0
 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)
예제 #15
0
 def editLocalFile(self, fds):
     repo = self._repoAgentFor(fds[0]).rawRepo()
     filenames = _lcanonpaths(fds)
     qtlib.editfiles(repo, filenames, parent=self.parent())
예제 #16
0
 def editlocal(self):
     filenames = self.filelist.getSelectedFiles()
     if not filenames:
         return
     qtlib.editfiles(self.repo, filenames, parent=self)
예제 #17
0
 def onEditLocal(self):
     filenames = [self.filename]
     if not filenames:
         return
     qtlib.editfiles(self.repo, filenames, parent=self)
예제 #18
0
def edit(parent, ui, repo, files, lineno=None, search=None):
    qtlib.editfiles(repo, files, lineno, search, parent)
예제 #19
0
 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)
예제 #20
0
 def editlocal(self):
     repo, filenames, _rev = self._findsub(self._selectedfiles)
     if not filenames:
         return
     qtlib.editfiles(repo, filenames, parent=self.parent())
예제 #21
0
 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)
예제 #22
0
 def editlocal(self):
     repo, filenames, _rev = self._findsub(self._selectedfiles)
     if not filenames:
         return
     qtlib.editfiles(repo, filenames, parent=self.parent())
예제 #23
0
 def onEditLocal(self):
     filenames = [self.filename]
     if not filenames:
         return
     qtlib.editfiles(self.repo, filenames, parent=self)
예제 #24
0
 def editlocal(self):
     if self.path is None:
         return
     qtlib.editfiles(self._repo, [hglib.fromunicode(self.path)], parent=self)
예제 #25
0
def edit(parent, ui, repo, files, lineno=None, search=None):
    qtlib.editfiles(repo, files, lineno, search, parent)
예제 #26
0
 def onUnrevDoubleClicked(self, index):
     file = hglib.fromunicode(self.unrevlist.model().data(index).toString())
     qtlib.editfiles(self.repo, [file])