rebase: only change self.state when collapsing in _finishrebase
authorJun Wu <quark@fb.com>
Fri, 11 Aug 2017 01:34:11 -0700
changeset 33864 70354bd4f19b
parent 33863 3160876c6e4e
child 33865 af20468eb0a4
rebase: only change self.state when collapsing in _finishrebase When the code executes to _finishrebase, self.state should be populated with correct destinations and do not need to be written to a node. The code was introduced by 8dc45c9059, which seems to avoid setting state values to None but it didn't provide more details. Differential Revision: https://phab.mercurial-scm.org/D346
hgext/rebase.py
--- a/hgext/rebase.py	Thu Aug 10 22:17:15 2017 -0700
+++ b/hgext/rebase.py	Fri Aug 11 01:34:11 2017 -0700
@@ -461,12 +461,10 @@
                                        editor=editor,
                                        keepbranches=self.keepbranchesf,
                                        date=self.date)
-            if newnode is None:
-                newrev = self.dest
-            else:
+            if newnode is not None:
                 newrev = repo[newnode].rev()
-            for oldrev in self.state.iterkeys():
-                self.state[oldrev] = newrev
+                for oldrev in self.state.iterkeys():
+                    self.state[oldrev] = newrev
 
         if 'qtip' in repo.tags():
             updatemq(repo, self.state, self.skipped, **opts)