Patchwork D3876: rebase: check whether the rebasestate exists or not a bit early

login
register
mail settings
Submitter phabricator
Date July 2, 2018, 12:43 p.m.
Message ID <b7ca1254f24f14835d9001167433eb4c@localhost.localdomain>
Download mbox | patch
Permalink /patch/32565/
State Not Applicable
Headers show

Comments

phabricator - July 2, 2018, 12:43 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGcf24f678adda: rebase: check whether the rebasestate exists or not a bit early (authored by pulkit, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D3876?vs=9398&id=9407

REVISION DETAIL
  https://phab.mercurial-scm.org/D3876

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




To: pulkit, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -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: