Yuya Nishihara  committed 51cabf0

sync: show exception dialog for invalid call of pushclicked()

As the comment says, it is a coding error and should never happen.

  • Participants
  • Parent commits a61d306

Comments (0)

Files changed (1)

File tortoisehg/hgqt/

         if branch == '':
             branch = None
         if pushall and (rev is not None or branch is not None):
-            # This should never happen
-            qtlib.ErrorMsg(_('Internal TortoiseHg Error'),
-                _('Inconsistent call to SyncWidget.pushclicked()'),
-                _('Cannot call SyncWidget.pushclicked() with pushall=True, '
-                'rev!=None and branch!=None'))
-            return
+            raise ValueError('inconsistent call with pushall=%r, rev=%r and '
+                             'branch=%r' % (pushall, rev, branch))
         validopts = ('force', 'new-branch', 'branch', 'rev', 'bookmark', 'mq')
         url = self.currentPushUrl()