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

login
register
mail settings
Submitter phabricator
Date Aug. 11, 2017, 9:02 a.m.
Message ID <differential-rev-PHID-DREV-qozgil3tjq4gdtq2kfru-req@phab.mercurial-scm.org>
Download mbox | patch
Permalink /patch/22867/
State Superseded
Headers show

Comments

phabricator - Aug. 11, 2017, 9:02 a.m.
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




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

Patch

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)