Patchwork D7730: rebase: make sure pruning does not confuse rebase (issue6180)

login
register
mail settings
Submitter phabricator
Date Feb. 1, 2020, 6:40 p.m.
Message ID <84a6329054eab1efd2079d7f6b5fc374@localhost.localdomain>
Download mbox | patch
Permalink /patch/44866/
State Not Applicable
Headers show

Comments

phabricator - Feb. 1, 2020, 6:40 p.m.
khanchi97 updated this revision to Diff 19816.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D7730?vs=19283&id=19816

BRANCH
  default

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

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

AFFECTED FILES
  hgext/rebase.py
  tests/test-rebase-conflicts.t

CHANGE DETAILS




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

Patch

diff --git a/tests/test-rebase-conflicts.t b/tests/test-rebase-conflicts.t
--- a/tests/test-rebase-conflicts.t
+++ b/tests/test-rebase-conflicts.t
@@ -481,14 +481,13 @@ 
   $ hg resolve -m
   (no more unresolved files)
   continue: hg rebase --continue
-XXX: it should have rebased revision 3 since it made changes unrelated to
-destination, so no reason to say "its destination already has all its changes"
   $ hg rebase -c
   note: not rebasing 2:06a50ac6b5ab "conflict in a", it has no successor
   rebasing 3:aea370672fd7 "add b" (tip)
-  note: not rebasing 3:aea370672fd7 "add b" (tip), its destination already has all its changes
   $ hg tglog
-  @  1:draft 'edit a'
+  @  4:draft 'add b'
+  |
+  o  1:draft 'edit a'
   |
   o  0:draft 'add a'
   
diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -594,6 +594,10 @@ 
                 adjustdest(repo, rev, self.destmap, self.state, self.skipped)
             )
             self.state[rev] = dest
+            # since we are done, make sure wdir has one parent (issue6180)
+            if len(self.wctx.parents()) == 2:
+                p1 = self.wctx.p1().node()
+                self.wctx.setparents(p1)
         elif self.state[rev] == revtodo:
             ui.status(_(b'rebasing %s\n') % desc)
             progressfn(ctx)