Patchwork [5,of,5,v3] rebase: use explicit ancestor when rebasing an ancestor child

login
register
mail settings
Submitter Mads Kiilerich
Date Dec. 4, 2014, 3:12 a.m.
Message ID <b7893dbf20d31550b209.1417662769@localhost.localdomain>
Download mbox | patch
Permalink /patch/6992/
State Changes Requested
Headers show

Comments

Mads Kiilerich - Dec. 4, 2014, 3:12 a.m.
# HG changeset patch
# User Mads Kiilerich <madski@unity3d.com>
# Date 1417662628 -3600
#      Thu Dec 04 04:10:28 2014 +0100
# Node ID b7893dbf20d31550b20907cc7a68dc03a45c8222
# Parent  742988c7a05cb1bd49f9be0f057a9c8ef4e20d95
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.
Pierre-Yves David - Dec. 5, 2014, 12:26 a.m.
On 12/03/2014 07:12 PM, Mads Kiilerich wrote:
> # HG changeset patch
> # User Mads Kiilerich <madski@unity3d.com>
> # Date 1417662628 -3600
> #      Thu Dec 04 04:10:28 2014 +0100
> # Node ID b7893dbf20d31550b20907cc7a68dc03a45c8222
> # Parent  742988c7a05cb1bd49f9be0f057a9c8ef4e20d95
> 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.

Why is it more correct? Does the lack of test change mean it is correct 
or that it is badly tested?

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -596,10 +596,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
@@ -632,7 +632,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 - untested\n')
-            return target, rev, None, target, nullrev
+            return target, rev, p2, target, nullrev
         if p2_ >= nullrev:
             repo.ui.warn(' p1=nullrev, p2 rebased - untested\n')
             return p2_, rev, p2, p2_, nullrev
@@ -641,7 +641,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