Commits

Yuya Nishihara committed 9985de1

revert: move check of invalid revision specifier where rev is used

  • Participants
  • Parent commits 8cf451b

Comments (0)

Files changed (1)

File tortoisehg/hgqt/revert.py

 
 class RevertDialog(QDialog):
     def __init__(self, repo, wfiles, rev, parent):
-        if rev is None:
-            raise ValueError('Cannot revert to working directory')
+        super(RevertDialog, self).__init__(parent)
 
-        super(RevertDialog, self).__init__(parent)
         self.setWindowTitle(_('Revert - %s') % repo.displayname)
 
         f = self.windowFlags()
         self.bbox = bbox
 
     def _addRevertTargetCombo(self, rev):
+        if rev is None:
+            raise ValueError('Cannot revert to working directory')
         self.revcombo = QComboBox()
         revnames = ['revision %d' % rev]
         ctx = self.repo[rev]