1. TortoiseHg
  2. TortoiseHg
  3. thg


Angel Ezquerra  committed c52933e

workbench: improve push infobar message

Up until now the infobar message that is shown on outgoing had a button with
the text 'Push' on it. This did not take into account the
'tortoisehg.defaultpush' setting, which can change the behavior of the push

This patch shows a different text on te push button depending on the defaultpush
setting ('Push', 'Push current branch' or 'Push current revision').

I thought about putting the actual branch name or revision number on the button
as well. However this could lead to error if the user updates to a different
revision or branch while the infobar push message is being shown.

I could fix the rev and/or revision that is being pushed to when you click the
button, rather than using the current one to solve that issue. However I think
that is less flexible than the current solution (that let's you update to a
different revision before push without having to do a new update), and it could
also break down if the user stripped the current revision before hitting push.

My only concern is that an unexperienced user may believe that 'Push current
revision' will only push the current revision, not its ancestors. However this
should not be a common mistake (and if it is, the user has greater problems
anyway :-P). Another concern is that a user could believe that 'current revision'
equals 'selected revision'. In any case I still think that this is an
improvement over the current situation, where you do not know what you are

  • Participants
  • Parent commits 3ef455e
  • Branches stable

Comments (0)

Files changed (1)

File tortoisehg/hgqt/repowidget.py

View file
  • Ignore whitespace
         w = self.setInfoBar(qtlib.ConfirmInfoBar,
                             _('%d outgoing changesets') % len(nodes))
         assert w
-        w.acceptButton.setText(_('Push'))
+        # Read the tortoisehg.defaultpush setting to determine what to push
+        # by default
+        acceptbuttontext = _('Push')
+        defaultpush = self.repo.ui.config('tortoisehg', 'defaultpush', 'all')
+        if defaultpush == 'branch':
+            acceptbuttontext = _('Push current branch')
+        elif defaultpush == 'revision':
+            acceptbuttontext = _('Push current revision')
+        w.acceptButton.setText(acceptbuttontext)
         w.accepted.connect(lambda: self.push(False))  # TODO: to the same URL