Changeset 66aa04af1ab2…
Parent bf5aeb1558df…
by
Changes to 2 files · Browse files at 66aa04af1ab2 Showing diff from parent bf5aeb1558df Diff from another changeset...
@@ -79,10 +79,31 @@ self.basenode = None
self.destroyed.connect(self.repo.thginvalidate)
+ # Determine the "initial revision" that must be shown when
+ # opening the repo.
+ # The "initial revision" can be selected via the settings, and it can
+ # have 3 possible values:
+ # - "current": Select the current (i.e. working dir parent) revision
+ # - "tip": Select tip of the repository
+ # - "workingdir": Select the working directory pseudo-revision
+ initialRevision= \
+ self.repo.ui.config('tortoisehg', 'initialrevision', 'current').lower()
+
+ initialRevisionDict = {
+ 'current': '.',
+ 'tip': 'tip',
+ 'workingdir': None
+ }
+ if initialRevision in initialRevisionDict:
+ default_rev = initialRevisionDict[initialRevision]
+ else:
+ # By default we'll select the current (i.e. working dir parent) revision
+ default_rev = '.'
+
if repo.parents()[0].rev() == -1:
self._reload_rev = 'tip'
else:
- self._reload_rev = '.'
+ self._reload_rev = default_rev
self.currentMessage = ''
self.dirty = False
@@ -97,6 +118,30 @@ self.runner.makeLogVisible.connect(self.makeLogVisible)
self.runner.commandFinished.connect(self.onCommandFinished)
+ # Select the widget chosen by the user
+ defaultWidget = \
+ self.repo.ui.config(
+ 'tortoisehg', 'defaultwidget', 'revdetails').lower()
+ widgetDict = {
+ 'revdetails': self.logTabIndex,
+ 'commit': self.commitTabIndex,
+ 'mq': self.mqTabIndex,
+ 'sync': self.syncTabIndex,
+ 'manifest': self.manifestTabIndex,
+ 'search': self.grepTabIndex
+ }
+ if initialRevision == 'workingdir':
+ # Do not allow selecting the revision details widget when the
+ # selected revision is the working directory pseudo-revision
+ widgetDict['revdetails'] = self.commitTabIndex
+
+ if defaultWidget in widgetDict:
+ widgetIndex = widgetDict[defaultWidget]
+ # Note: if the mq extension is not enabled, self.mqTabIndex will
+ # be negative
+ if widgetIndex > 0:
+ self.taskTabsWidget.setCurrentIndex(widgetIndex)
+
def setupUi(self):
SP = QSizePolicy
|
@@ -410,6 +410,17 @@ )),
({'name': 'log', 'label': _('Workbench'), 'icon': 'menulog'}, (
+ _fi(_('Default widget'), 'tortoisehg.defaultwidget', (genDefaultCombo,
+ ['revdetails', 'commit', 'mq', 'sync', 'manifest', 'search']),
+ _('Select the initial widget that will be shown when opening a '
+ 'repository. '
+ 'Default: revdetails')),
+ _fi(_('Initial revision'), 'tortoisehg.initialrevision', (genDefaultCombo,
+ ['current', 'tip', 'workingdir']),
+ _('Select the initial revision that will be selected when opening a '
+ 'repository. You can select the "current" (i.e. the working directory '
+ 'parent), the current "tip" or the working directory ("workingdir"). '
+ 'Default: current')),
_fi(_('Author Coloring'), 'tortoisehg.authorcolor', genBoolCombo,
_('Color changesets by author name. If not enabled, '
'the changes are colored green for merge, red for '
|
Loading...