Commits

Yuya Nishihara committed e54bfa5 Merge

Merge with stable

  • Participants
  • Parent commits 0e6a0b8, 3fb940d

Comments (0)

Files changed (4)

File tortoisehg/hgqt/manifestdialog.py

         from tortoisehg.hgqt import run
         run.grep(self._repo.ui, hglib.fromunicode(pattern), **opts)
 
-    @pyqtSlot(unicode, object, int)
-    def _openInEditor(self, path, rev, line):
-        """Open editor to show the specified file"""
-        _openineditor(self._repo, path, rev, line,
-                      pattern=self._fileview.searchbar.pattern(), parent=self)
-
 class ManifestWidget(QWidget, qtlib.TaskWidget):
     """Display file tree and contents at the specified revision"""
 
     searchbar.conditionChanged.connect(manifestwidget.highlightText)
     searchbar.searchRequested.connect(manifestwidget.find)
 
-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 run(ui, *pats, **opts):
     repo = opts.get('repo') or thgrepo.repository(ui, paths.find_root())
     try:

File tortoisehg/hgqt/repomodel.py

         self._user_colors = {}
         self._branch_colors = {}
 
-        self._columnmap = {
-            'Rev':      self.getrev,
-            'Node':     lambda ctx, gnode: str(ctx),
-            'Graph':    lambda ctx, gnode: "",
-            'Description': self.getlog,
-            'Author':   self.getauthor,
-            'Tags':     self.gettags,
-            'Branch':   self.getbranch,
-            'Filename': lambda ctx, gnode: gnode.extra[0],
-            'Age':      lambda ctx, gnode: hglib.age(ctx.date()).decode('utf-8'),
-            'LocalTime':lambda ctx, gnode: hglib.displaytime(ctx.date()),
-            'UTCTime':  lambda ctx, gnode: hglib.utctime(ctx.date()),
-            'Changes':  self.getchanges,
-        }
-
         if repo:
             self.reloadConfig()
             self.updateColumns()
         ctx = self.repo.changectx(gnode.rev)
 
         if role == Qt.DisplayRole:
-            text = self._columnmap[column](ctx, gnode)
+            text = self._columnmap[column](self, ctx, gnode)
             if not isinstance(text, (QString, unicode)):
                 text = hglib.tounicode(text)
             return QVariant(text)
         if R:
             addtotal(R, 'log.removed')
         return ''.join(changes)
+
+    _columnmap = {
+        'Rev':      getrev,
+        'Node':     lambda self, ctx, gnode: str(ctx),
+        'Graph':    lambda self, ctx, gnode: "",
+        'Description': getlog,
+        'Author':   getauthor,
+        'Tags':     gettags,
+        'Branch':   getbranch,
+        'Filename': lambda self, ctx, gnode: gnode.extra[0],
+        'Age':      lambda self, ctx, gnode: hglib.age(ctx.date()).decode('utf-8'),
+        'LocalTime':lambda self, ctx, gnode: hglib.displaytime(ctx.date()),
+        'UTCTime':  lambda self, ctx, gnode: hglib.utctime(ctx.date()),
+        'Changes':  getchanges,
+    }

File tortoisehg/hgqt/settings.py

         'repository.  You can select the "current" (i.e. the working directory '
         'parent), the current "tip" or the working directory ("workingdir"). '
         'Default: current')),
+    _fi(_('Open new tabs next\nto the current tab'),
+        'tortoisehg.opentabsaftercurrent', genBoolRBGroup,
+        _('Should new tabs be open next to the current tab? '
+        'If False new tabs will be open after the last tab. '
+        'Default: True')),
     _fi(_('Author Coloring'), 'tortoisehg.authorcolor', genBoolRBGroup,
         _('Color changesets by author name.  If not enabled, '
           'the changes are colored green for merge, red for '

File tortoisehg/hgqt/workbench.py

         rw.repoChanged.connect(self.reporegistry.repoChanged)
 
         tw = self.repoTabsWidget
-        index = self.repoTabsWidget.addTab(rw, rw.title())
+        # We can open new tabs next to the current one or next to the last tab
+        openTabAfterCurrent = self.ui.configbool('tortoisehg',
+            'opentabsaftercurrent', True)
+        if openTabAfterCurrent:
+            index = self.repoTabsWidget.insertTab(
+                tw.currentIndex()+1, rw, rw.title())
+        else:
+            index = self.repoTabsWidget.addTab(rw, rw.title())
+
         tw.setCurrentIndex(index)
         rw.titleChanged.connect(
             lambda title: tw.setTabText(tw.indexOf(rw), title))