Patchwork [5,of,8] rebase: move check for "rebase in progress"

login
register
mail settings
Submitter Christian Delahousse
Date Oct. 16, 2015, 2:33 a.m.
Message ID <73fa24b0b32b6b65f3c3.1444962814@dev4253.prn1.facebook.com>
Download mbox | patch
Permalink /patch/11135/
State Changes Requested
Headers show

Comments

Christian Delahousse - Oct. 16, 2015, 2:33 a.m.
# HG changeset patch
# User Christian Delahousse <cdelahousse@fb.com>
# Date 1444953637 25200
#      Thu Oct 15 17:00:37 2015 -0700
# Node ID 73fa24b0b32b6b65f3c3c71d066f54e149b69b87
# Parent  ef6cee42f6058ae824978db8559920dd6c1e3fb2
rebase: move check for "rebase in progress"

Moved the code that checks for no rebase in progress out of the try catch to
make the block's scope smaller. Will help in for next patch in series

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -259,11 +259,6 @@ 
 
             try:
                 result = restorestatus(repo)
-                if not result:
-                    raise error.Abort(_('no rebase in progress'))
-
-                (originalwd, target, state, skipped, collapsef, keepf,
-                 keepbranchesf, external, activebookmark) = result
             except error.RepoLookupError:
                 if abortf:
                     clearstatus(repo)
@@ -274,6 +269,13 @@ 
                     msg = _('cannot continue inconsistent rebase')
                     hint = _('use "hg rebase --abort" to clear broken state')
                     raise error.Abort(msg, hint=hint)
+
+            if not result:
+                raise error.Abort(_('no rebase in progress'))
+
+            (originalwd, target, state, skipped, collapsef, keepf,
+                keepbranchesf, external, activebookmark) = result
+
             if abortf:
                 return abort(repo, originalwd, target, state,
                              activebookmark=activebookmark)