changeset 33864:70354bd4f19b

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
author Jun Wu <quark@fb.com>
date Fri, 11 Aug 2017 01:34:11 -0700
parents 3160876c6e4e
children af20468eb0a4
files hgext/rebase.py
diffstat 1 files changed, 3 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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)