# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1530387039 -19800 # Node ID cf24f678addaef55b00dc99c947808057951d910 # Parent 4df9cef867403b319cfcaf4f3858dd7be7323b2e 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 diff -r 4df9cef86740 -r cf24f678adda 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: