rebase: check whether the rebasestate exists or not a bit early
authorPulkit Goyal <7895pulkit@gmail.com>
Sun, 01 Jul 2018 01:00:39 +0530
changeset 38518 cf24f678adda
parent 38517 4df9cef86740
child 38519 4455e5d4d59c
rebase: check whether the rebasestate exists or not a bit early Converted the else part into `if True` because that part will soon be under a except part. Differential Revision: https://phab.mercurial-scm.org/D3876
hgext/rebase.py
--- a/hgext/rebase.py	Sun Jul 01 00:52:25 2018 +0530
+++ b/hgext/rebase.py	Sun Jul 01 01:00:39 2018 +0530
@@ -227,6 +227,9 @@
 
     def restorestatus(self):
         """Restore a previously stored status"""
+        if not self.stateobj.exists():
+            cmdutil.wrongtooltocontinue(self.repo, _('rebase'))
+
         data = self._read()
         self.repo.ui.debug('rebase status resumed\n')
 
@@ -250,9 +253,7 @@
         state = {}
         destmap = {}
 
-        if not self.stateobj.exists():
-            cmdutil.wrongtooltocontinue(repo, _('rebase'))
-        else:
+        if True:
             f = repo.vfs("rebasestate")
             for i, l in enumerate(f.read().splitlines()):
                 if i == 0: