D346: rebase: only change self.state when collapsing in _finishrebase

quark (Jun Wu) phabricator at mercurial-scm.org
Fri Aug 11 09:02:07 UTC 2017


quark created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  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 https://phab.mercurial-scm.org/rHG8dc45c905989891b0cc075809344268427b95e92, which seems to avoid setting state values to None
  but it didn't provide more details.

REPOSITORY
  rHG Mercurial

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

AFFECTED FILES
  hgext/rebase.py

CHANGE DETAILS

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -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)



To: quark, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list