Patchwork D7905: rebase: move some variables after an error cases where they're not needed

login
register
mail settings
Submitter phabricator
Date Jan. 24, 2020, 11:27 p.m.
Message ID <fe5386c8bf5217e186fb2a65d9f1a2ab@localhost.localdomain>
Download mbox | patch
Permalink /patch/44636/
State Not Applicable
Headers show

Comments

phabricator - Jan. 24, 2020, 11:27 p.m.
Closed by commit rHG1cb7ae9b0071: rebase: move some variables after an error cases where they&#039;re not needed (authored by martinvonz).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7905?vs=19341&id=19579

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D7905/new/

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS




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

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -1793,14 +1793,6 @@ 
             for i, revs in enumerate(unwanted)
             if revs is not None
         )
-        base = bases[i]
-
-        # newps[0] should match merge base if possible. Currently, if newps[i]
-        # is nullrev, the only case is newps[i] and newps[j] (j < i), one is
-        # the other's ancestor. In that case, it's fine to not swap newps here.
-        # (see CASE-1 and CASE-2 above)
-        if i != 0 and newps[i] != nullrev:
-            newps[0], newps[i] = newps[i], newps[0]
 
         # The merge will include unwanted revisions. Abort now. Revisit this if
         # we have a more advanced merge algorithm that handles multiple bases.
@@ -1817,6 +1809,15 @@ 
                 % (rev, repo[rev], unwanteddesc)
             )
 
+        base = bases[i]
+
+        # newps[0] should match merge base if possible. Currently, if newps[i]
+        # is nullrev, the only case is newps[i] and newps[j] (j < i), one is
+        # the other's ancestor. In that case, it's fine to not swap newps here.
+        # (see CASE-1 and CASE-2 above)
+        if i != 0 and newps[i] != nullrev:
+            newps[0], newps[i] = newps[i], newps[0]
+
     repo.ui.debug(b" future parents are %d and %d\n" % tuple(newps))
 
     return newps[0], newps[1], base