Patchwork [15,of,17] rebase: use explicit ancestor when rebasing an ancestor child

login
register
mail settings
Submitter Mads Kiilerich
Date Nov. 30, 2014, 7:08 p.m.
Message ID <c6efb8f700c44b0183be.1417374522@localhost.localdomain>
Download mbox | patch
Permalink /patch/6920/
State Changes Requested
Headers show

Comments

Mads Kiilerich - Nov. 30, 2014, 7:08 p.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1417374421 -3600
#      Sun Nov 30 20:07:01 2014 +0100
# Node ID c6efb8f700c44b0183be979854be11c1b551ee66
# Parent  7e95d2f0e501ea79f77697c89247c2949ab987d8
rebase: use explicit ancestor when rebasing an ancestor child

This cleans up after the single change in test-rebase-obsolete.t caused by the
previous computerebase refactoring. This clean-up do not cause any test changes.

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -613,10 +613,10 @@  def computerebase(repo, rev, target, sta
 
         \  p2     null         ancestor        rebased        outside
       p1 \
-    null       target,rev|  target,rev|None  p2',rev|p2    target,rev|p2
+    null       target,rev|   target,rev|p2   p2',rev|p2    target,rev|p2
                  target         target           p2'          target
 
-    ancestor target,rev|Non target,rev|None  p2',rev|p2   target,rev|None
+    ancestor  target,rev|p1 target,rev|None  p2',rev|p2   target,rev|None
                  target         target           p2'         target,p2
 
     rebased    p1',rev|p1     p1',rev|p1    target,rev|p1   p1',rev|p1
@@ -649,7 +649,7 @@  def computerebase(repo, rev, target, sta
         # These can't happen with normal hg but might happen anyway:
         if p2 in targetancestors:
             repo.ui.warn(' p1=nullrev, p2 ancestor\n') # untested
-            return target, rev, None, target, nullrev
+            return target, rev, p2, target, nullrev
         if p2_ >= nullrev:
             repo.ui.warn(' p1=nullrev, p2 rebased\n') # untested
             return p2_, rev, p2, p2_, nullrev
@@ -658,7 +658,7 @@  def computerebase(repo, rev, target, sta
     if p1 in targetancestors:
         if p2 == nullrev:
             repo.ui.debug(' p1 ancestor, p2=nullrev\n')
-            return target, rev, None, target, nullrev
+            return target, rev, p1, target, nullrev
         if p2 in targetancestors:
             repo.ui.debug(' p1 ancestor, p2 ancestor\n')
             return target, rev, None, target, nullrev