Patchwork [2,of,2] rebase: preserve working directory parent (BC)

login
register
mail settings
Submitter Pierre-Yves David
Date Oct. 14, 2013, 2:50 p.m.
Message ID <b94e088ccbedbdcf4076.1381762232@vulgaris>
Download mbox | patch
Permalink /patch/2757/
State Accepted
Commit 9c78ed396075f2fd3b0a860fb9888adea554c605
Headers show

Comments

Pierre-Yves David - Oct. 14, 2013, 2:50 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
# Date 1381759949 -7200
#      Mon Oct 14 16:12:29 2013 +0200
# Node ID b94e088ccbedbdcf407658f2e41305027ba58464
# Parent  b24448b7d0e6e0b0d871871ddb40b68f95eee7c7
rebase: preserve working directory parent (BC)

Prior to this changeset, rebase always left the working directory as a parent of
the last rebased changeset. The is dubious when, before the rebase, the working
directory was not a parent of the tip most rebased changeset.

With this changeset, we move the working directory back to its original parent.
If the original parent was rebased, we use it's successors.

This is a step toward solving issue3813 (rebase loses active bookmark if it's
not on a head)
Angel Ezquerra - Oct. 15, 2013, 7:32 p.m.
El 14/10/2013 17:00, <pierre-yves.david@ens-lyon.org> escribió:
>
> # HG changeset patch
> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> # Date 1381759949 -7200
> #      Mon Oct 14 16:12:29 2013 +0200
> # Node ID b94e088ccbedbdcf407658f2e41305027ba58464
> # Parent  b24448b7d0e6e0b0d871871ddb40b68f95eee7c7
> rebase: preserve working directory parent (BC)
>
> Prior to this changeset, rebase always left the working directory as a
parent of
> the last rebased changeset. The is dubious when, before the rebase, the
working
> directory was not a parent of the tip most rebased changeset.
>
> With this changeset, we move the working directory back to its original
parent.
> If the original parent was rebased, we use it's successors.

I'm not necessarily against this change, but isn't this a backwards
incompatible change?

Angel
Matt Mackall - Oct. 15, 2013, 7:54 p.m.
On Tue, 2013-10-15 at 21:32 +0200, Angel Ezquerra wrote:
> El 14/10/2013 17:00, <pierre-yves.david@ens-lyon.org> escribió:
> >
> > # HG changeset patch
> > # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> > # Date 1381759949 -7200
> > #      Mon Oct 14 16:12:29 2013 +0200
> > # Node ID b94e088ccbedbdcf407658f2e41305027ba58464
> > # Parent  b24448b7d0e6e0b0d871871ddb40b68f95eee7c7
> > rebase: preserve working directory parent (BC)
> >
> > Prior to this changeset, rebase always left the working directory as a
> parent of
> > the last rebased changeset. The is dubious when, before the rebase, the
> working
> > directory was not a parent of the tip most rebased changeset.
> >
> > With this changeset, we move the working directory back to its original
> parent.
> > If the original parent was rebased, we use it's successors.
> 
> I'm not necessarily against this change, but isn't this a backwards
> incompatible change?

That's why it's marked "(BC)". It has nothing to do with any rumored
secret base in British Columbia.

I'm on the fence on this one, but I'm leaning towards accepting it. In
the distant future, we may end up doing many rebases entirely in memory,
so this side-effect of the current implementation would also disappear.
If someone has a scenario or workflow where it matters, let's hear about
it.
Angel Ezquerra - Oct. 16, 2013, 12:03 a.m.
El 15/10/2013 21:54, "Matt Mackall" <mpm@selenic.com> escribió:
>
> On Tue, 2013-10-15 at 21:32 +0200, Angel Ezquerra wrote:
> > El 14/10/2013 17:00, <pierre-yves.david@ens-lyon.org> escribió:
> > >
> > > # HG changeset patch
> > > # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> > > # Date 1381759949 -7200
> > > #      Mon Oct 14 16:12:29 2013 +0200
> > > # Node ID b94e088ccbedbdcf407658f2e41305027ba58464
> > > # Parent  b24448b7d0e6e0b0d871871ddb40b68f95eee7c7
> > > rebase: preserve working directory parent (BC)
> > >
> > > Prior to this changeset, rebase always left the working directory as a
> > parent of
> > > the last rebased changeset. The is dubious when, before the rebase,
the
> > working
> > > directory was not a parent of the tip most rebased changeset.
> > >
> > > With this changeset, we move the working directory back to its
original
> > parent.
> > > If the original parent was rebased, we use it's successors.
> >
> > I'm not necessarily against this change, but isn't this a backwards
> > incompatible change?
>
> That's why it's marked "(BC)". It has nothing to do with any rumored
> secret base in British Columbia.

LOL! I had not noticed it but I don't think I would have understood what BC
meant even if I had.

> I'm on the fence on this one, but I'm leaning towards accepting it. In
> the distant future, we may end up doing many rebases entirely in memory,
> so this side-effect of the current implementation would also disappear.
> If someone has a scenario or workflow where it matters, let's hear about
> it.

Actually now that I think about this a bit more, I think it does make a lot
of sense.

When I teach other people about mercurial I always tell them that most
mercurial commands modify either the working copy out the repository
history, but not both. This helps explain the difference between update and
revert and that merge does not create a new revision, for example.

Rebase is (was?) one of the few exceptions to this rule. It'd be nice if
this particular exception was gone.

Cheers,

Angel
Augie Fackler - Oct. 16, 2013, 1:50 p.m.
On Wed, Oct 16, 2013 at 02:03:02AM +0200, Angel Ezquerra wrote:
> El 15/10/2013 21:54, "Matt Mackall" <mpm@selenic.com> escribió:
> >
> > On Tue, 2013-10-15 at 21:32 +0200, Angel Ezquerra wrote:
> > > El 14/10/2013 17:00, <pierre-yves.david@ens-lyon.org> escribió:
> > > >
> > > > # HG changeset patch
> > > > # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
> > > > # Date 1381759949 -7200
> > > > #      Mon Oct 14 16:12:29 2013 +0200
> > > > # Node ID b94e088ccbedbdcf407658f2e41305027ba58464
> > > > # Parent  b24448b7d0e6e0b0d871871ddb40b68f95eee7c7
> > > > rebase: preserve working directory parent (BC)
> > > >
> > > > Prior to this changeset, rebase always left the working directory as a
> > > parent of
> > > > the last rebased changeset. The is dubious when, before the rebase,
> the
> > > working
> > > > directory was not a parent of the tip most rebased changeset.
> > > >
> > > > With this changeset, we move the working directory back to its
> original
> > > parent.
> > > > If the original parent was rebased, we use it's successors.
> > >
> > > I'm not necessarily against this change, but isn't this a backwards
> > > incompatible change?
> >
> > That's why it's marked "(BC)". It has nothing to do with any rumored
> > secret base in British Columbia.
>
> LOL! I had not noticed it but I don't think I would have understood what BC
> meant even if I had.
>
> > I'm on the fence on this one, but I'm leaning towards accepting it. In
> > the distant future, we may end up doing many rebases entirely in memory,
> > so this side-effect of the current implementation would also disappear.
> > If someone has a scenario or workflow where it matters, let's hear about
> > it.
>
> Actually now that I think about this a bit more, I think it does make a lot
> of sense.

I'm in favor of the change, for what it's worth. Having used evolve
for a while now, I actually find myself occasionally surprised when
rebase /doesn't/ work this way.

>
> When I teach other people about mercurial I always tell them that most
> mercurial commands modify either the working copy out the repository
> history, but not both. This helps explain the difference between update and
> revert and that merge does not create a new revision, for example.
>
> Rebase is (was?) one of the few exceptions to this rule. It'd be nice if
> this particular exception was gone.
>
> Cheers,
>
> Angel

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel
Durham Goode - Oct. 16, 2013, 5:02 p.m.
On 10/16/13 6:50 AM, "Augie Fackler" <raf@durin42.com> wrote:

>On Wed, Oct 16, 2013 at 02:03:02AM +0200, Angel Ezquerra wrote:
>> El 15/10/2013 21:54, "Matt Mackall" <mpm@selenic.com> escribió:
>> >
>> > On Tue, 2013-10-15 at 21:32 +0200, Angel Ezquerra wrote:
>> > > El 14/10/2013 17:00, <pierre-yves.david@ens-lyon.org> escribió:
>> > > >
>> > > > # HG changeset patch
>> > > > # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
>> > > > # Date 1381759949 -7200
>> > > > #      Mon Oct 14 16:12:29 2013 +0200
>> > > > # Node ID b94e088ccbedbdcf407658f2e41305027ba58464
>> > > > # Parent  b24448b7d0e6e0b0d871871ddb40b68f95eee7c7
>> > > > rebase: preserve working directory parent (BC)
>> > > >
>> > > > Prior to this changeset, rebase always left the working directory
>>as a
>> > > parent of
>> > > > the last rebased changeset. The is dubious when, before the
>>rebase,
>> the
>> > > working
>> > > > directory was not a parent of the tip most rebased changeset.
>> > > >
>> > > > With this changeset, we move the working directory back to its
>> original
>> > > parent.
>> > > > If the original parent was rebased, we use it's successors.
>> > >
>> > > I'm not necessarily against this change, but isn't this a backwards
>> > > incompatible change?
>> >
>> > That's why it's marked "(BC)". It has nothing to do with any rumored
>> > secret base in British Columbia.
>>
>> LOL! I had not noticed it but I don't think I would have understood
>>what BC
>> meant even if I had.
>>
>> > I'm on the fence on this one, but I'm leaning towards accepting it. In
>> > the distant future, we may end up doing many rebases entirely in
>>memory,
>> > so this side-effect of the current implementation would also
>>disappear.
>> > If someone has a scenario or workflow where it matters, let's hear
>>about
>> > it.
>>
>> Actually now that I think about this a bit more, I think it does make a
>>lot
>> of sense.
>
>I'm in favor of the change, for what it's worth. Having used evolve
>for a while now, I actually find myself occasionally surprised when
>rebase /doesn't/ work this way.
>

+1 on this change.  Leaving me on whatever random commit happens to be tip
after a rebase is at best useless, and at worst confusing.
Martin Geisler - Oct. 17, 2013, 7:18 a.m.
Durham Goode <durham@fb.com> writes:

> On 10/16/13 6:50 AM, "Augie Fackler" <raf@durin42.com> wrote:
>
>>On Wed, Oct 16, 2013 at 02:03:02AM +0200, Angel Ezquerra wrote:
>>> El 15/10/2013 21:54, "Matt Mackall" <mpm@selenic.com> escribió:
>>>>
>>>> On Tue, 2013-10-15 at 21:32 +0200, Angel Ezquerra wrote:
>>>>> El 14/10/2013 17:00, <pierre-yves.david@ens-lyon.org> escribió:
>>>>>>
>>>>>> # HG changeset patch
>>>>>> # User Pierre-Yves David <pierre-yves.david@ens-lyon.org>
>>>>>> # Date 1381759949 -7200
>>>>>> #      Mon Oct 14 16:12:29 2013 +0200
>>>>>> # Node ID b94e088ccbedbdcf407658f2e41305027ba58464
>>>>>> # Parent  b24448b7d0e6e0b0d871871ddb40b68f95eee7c7
>>>>>> rebase: preserve working directory parent (BC)
>>>>>>
>>>>>> Prior to this changeset, rebase always left the working directory
>>>>>> as a parent of the last rebased changeset. The is dubious when,
>>>>>> before the rebase, the working directory was not a parent of the
>>>>>> tip most rebased changeset.
>>>>>>
>>>>>> With this changeset, we move the working directory back to its
>>>>>> original parent. If the original parent was rebased, we use it's
>>>>>> successors.
>>>>>
>>>>> I'm not necessarily against this change, but isn't this a
>>>>> backwards incompatible change?
>>>>
>>>> That's why it's marked "(BC)". It has nothing to do with any
>>>> rumored secret base in British Columbia.
>>>
>>> LOL! I had not noticed it but I don't think I would have understood
>>> what BC meant even if I had.

Guys, please fix your mail clients. The quotes in the above was
completely messed up. They looked like this: http://paste2.org/BJb3vzjC

>>>> I'm on the fence on this one, but I'm leaning towards accepting
>>>> it. In the distant future, we may end up doing many rebases
>>>> entirely in memory, so this side-effect of the current
>>>> implementation would also disappear. If someone has a scenario or
>>>> workflow where it matters, let's hear about it.
>>>
>>> Actually now that I think about this a bit more, I think it does
>>> make a lot of sense.
>>
>> I'm in favor of the change, for what it's worth. Having used evolve
>> for a while now, I actually find myself occasionally surprised when
>> rebase /doesn't/ work this way.
>>
>
> +1 on this change.

Yeah, if my working copy parent revision isn't "involved" in the rebase
(not in the changesets that are to be rebased) then the update is
surprising.

> Leaving me on whatever random commit happens to be tip after a rebase
> is at best useless, and at worst confusing.

Only if I wasn't already at the tip of the to-be-rebased branch. That is
the typical case with 'hg pull; hg rebase' which normally does the right
thing for me.
Pierre-Yves David - Oct. 17, 2013, 7:43 a.m.
On 17 oct. 2013, at 09:18, Martin Geisler wrote:

> Durham Goode <durham@fb.com> writes:
> 
>> Leaving me on whatever random commit happens to be tip after a rebase
>> is at best useless, and at worst confusing.
> 
> Only if I wasn't already at the tip of the to-be-rebased branch. That is
> the typical case with 'hg pull; hg rebase' which normally does the right
> thing for me.

If you were at the tip of the to-be-rebased branch, this changeset will leave you at the top of the rebased result. So the most common case is not affected by this changes.
Martin Geisler - Oct. 17, 2013, 4:19 p.m.
Pierre-Yves David <pierre-yves.david@ens-lyon.org> writes:

> On 17 oct. 2013, at 09:18, Martin Geisler wrote:
>
>> Durham Goode <durham@fb.com> writes:
>> 
>>> Leaving me on whatever random commit happens to be tip after a
>>> rebase is at best useless, and at worst confusing.
>> 
>> Only if I wasn't already at the tip of the to-be-rebased branch. That
>> is the typical case with 'hg pull; hg rebase' which normally does the
>> right thing for me.
>
> If you were at the tip of the to-be-rebased branch, this changeset
> will leave you at the top of the rebased result. So the most common
> case is not affected by this changes.

Yes, I should have pointed out that this part of the patch makes it an
extra nice patch :)

Patch

diff --git a/hgext/rebase.py b/hgext/rebase.py
--- a/hgext/rebase.py
+++ b/hgext/rebase.py
@@ -332,10 +332,17 @@  def rebase(ui, repo, **opts):
                     nstate[repo[k].node()] = repo[v].node()
             # XXX this is the same as dest.node() for the non-continue path --
             # this should probably be cleaned up
             targetnode = repo[target].node()
 
+        # restore original working directory
+        # (we do this before stripping)
+        newwd = state.get(originalwd, originalwd)
+        if newwd not in [c.rev() for c in repo[None].parents()]:
+            ui.note(_("update back to initial working directory parent\n"))
+            hg.updaterepo(repo, newwd, False)
+
         if not keepf:
             collapsedas = None
             if collapsef:
                 collapsedas = newrev
             clearrebased(ui, repo, state, skipped, collapsedas)
diff --git a/tests/test-rebase-bookmarks.t b/tests/test-rebase-bookmarks.t
--- a/tests/test-rebase-bookmarks.t
+++ b/tests/test-rebase-bookmarks.t
@@ -117,22 +117,22 @@  Keep active bookmark on the correct chan
 
   $ hg rebase -d W
   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  3: 'C' bookmarks: Y Z
+  o  3: 'C' bookmarks: Y Z
   |
-  o  2: 'B' bookmarks: X
+  @  2: 'B' bookmarks: X
   |
   o  1: 'D' bookmarks: W
   |
   o  0: 'A' bookmarks:
   
 rebase --continue with bookmarks present (issue3802)
 
   $ hg up 2
-  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ echo 'C' > c
   $ hg add c
   $ hg ci -m 'other C'
   created new head
   $ hg up 3
diff --git a/tests/test-rebase-cache.t b/tests/test-rebase-cache.t
--- a/tests/test-rebase-cache.t
+++ b/tests/test-rebase-cache.t
@@ -119,15 +119,15 @@  Rebase part of branch2 (5-6) onto branch
   4: 'C' branch2
   2: 'B' branch1
   0: 'A' 
 
   $ hg tglog
-  @  8: 'E' branch3
+  o  8: 'E' branch3
   |
   o  7: 'D' branch3
   |
-  o  6: 'F' branch3
+  @  6: 'F' branch3
   |
   o  5: 'branch3' branch3
   |
   | o  4: 'C' branch2
   | |
diff --git a/tests/test-rebase-check-restore.t b/tests/test-rebase-check-restore.t
--- a/tests/test-rebase-check-restore.t
+++ b/tests/test-rebase-check-restore.t
@@ -78,15 +78,15 @@  Solve the conflict and go on:
   $ rm A.orig
   $ hg resolve -m A
   $ hg rebase --continue
 
   $ hg tglog
-  @  7:secret 'C'
+  o  7:secret 'C'
   |
   o  6:draft 'B'
   |
-  | o  5:draft 'F' notdefault
+  | @  5:draft 'F' notdefault
   | |
   o |  4:draft 'E'
   | |
   o |  3:draft 'D'
   |/
diff --git a/tests/test-rebase-collapse.t b/tests/test-rebase-collapse.t
--- a/tests/test-rebase-collapse.t
+++ b/tests/test-rebase-collapse.t
@@ -55,15 +55,15 @@  Rebasing B onto H and collapsing changes
 
   $ hg rebase --collapse --keepbranches
   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglogp
-  @  5:secret 'Collapsed revision
+  o  5:secret 'Collapsed revision
   |  * B
   |  * C
   |  * D'
-  o  4:draft 'H'
+  @  4:draft 'H'
   |
   | o  3:draft 'G'
   |/|
   o |  2:draft 'F'
   | |
@@ -90,14 +90,14 @@  Rebasing E onto H:
   $ hg phase --force --secret 6
   $ hg rebase --source 4 --collapse
   saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  6: 'Collapsed revision
+  o  6: 'Collapsed revision
   |  * E
   |  * G'
-  o  5: 'H'
+  @  5: 'H'
   |
   o  4: 'F'
   |
   | o  3: 'D'
   | |
@@ -126,13 +126,13 @@  Rebasing G onto H with custom message:
 
   $ hg rebase --source 4 --collapse -m 'custom message'
   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  6: 'custom message'
+  o  6: 'custom message'
   |
-  o  5: 'H'
+  @  5: 'H'
   |
   o  4: 'F'
   |
   | o  3: 'D'
   | |
@@ -233,15 +233,15 @@  Rebase and collapse - E onto H:
 
   $ hg rebase -s 4 --collapse # root (4) is not a merge
   saved backup bundle to $TESTTMP/b1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @    5: 'Collapsed revision
+  o    5: 'Collapsed revision
   |\   * E
   | |  * F
   | |  * G'
-  | o  4: 'H'
+  | @  4: 'H'
   | |
   o |    3: 'D'
   |\ \
   | o |  2: 'C'
   | |/
@@ -382,16 +382,16 @@  Rebase and collapse - E onto I:
   $ hg rebase -s 4 --collapse # root (4) is not a merge
   merging E
   saved backup bundle to $TESTTMP/c1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @    5: 'Collapsed revision
+  o    5: 'Collapsed revision
   |\   * E
   | |  * F
   | |  * G
   | |  * H'
-  | o  4: 'I'
+  | @  4: 'I'
   | |
   o |    3: 'D'
   |\ \
   | o |  2: 'C'
   | |/
@@ -471,16 +471,16 @@  Rebase and collapse - B onto F:
 
   $ hg rebase -s 1 --collapse
   saved backup bundle to $TESTTMP/d1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  2: 'Collapsed revision
+  o  2: 'Collapsed revision
   |  * B
   |  * C
   |  * D
   |  * E'
-  o  1: 'F'
+  @  1: 'F'
   |
   o  0: 'A'
   
   $ hg manifest --rev tip
   A
@@ -738,13 +738,13 @@  Test collapsing changes that add then re
   $ hg commit -Am b
   adding b
   $ hg rebase -d 0 -r "1::2" --collapse -m collapsed
   saved backup bundle to $TESTTMP/collapseaddremove/.hg/strip-backup/*-backup.hg (glob)
   $ hg tglog
-  @  1: 'collapsed'
+  o  1: 'collapsed'
   |
-  o  0: 'base'
+  @  0: 'base'
   
   $ hg manifest --rev tip
   b
   base
 
diff --git a/tests/test-rebase-detach.t b/tests/test-rebase-detach.t
--- a/tests/test-rebase-detach.t
+++ b/tests/test-rebase-detach.t
@@ -50,13 +50,13 @@  Rebasing D onto H detaching from C:
   $ hg phase --force --secret 3
   $ hg rebase -s 3 -d 7
   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg log -G --template "{rev}:{phase} '{desc}' {branches}\n"
-  @  7:secret 'D'
+  o  7:secret 'D'
   |
-  o  6:draft 'H'
+  @  6:draft 'H'
   |
   | o  5:draft 'G'
   |/|
   o |  4:draft 'F'
   | |
@@ -101,15 +101,15 @@  Rebasing C onto H detaching from B:
   
   $ hg rebase -s 2 -d 7
   saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  7: 'D'
+  o  7: 'D'
   |
   o  6: 'C'
   |
-  o  5: 'H'
+  @  5: 'H'
   |
   | o  4: 'G'
   |/|
   o |  3: 'F'
   | |
@@ -153,17 +153,17 @@  Rebasing B onto H using detach (same as 
   
   $ hg rebase -s 1 -d 7
   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  7: 'D'
+  o  7: 'D'
   |
   o  6: 'C'
   |
   o  5: 'B'
   |
-  o  4: 'H'
+  @  4: 'H'
   |
   | o  3: 'G'
   |/|
   o |  2: 'F'
   | |
@@ -207,14 +207,14 @@  Rebasing C onto H detaching from B and c
   
   $ hg rebase --collapse -s 2 -d 7
   saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg  log -G --template "{rev}:{phase} '{desc}' {branches}\n"
-  @  6:secret 'Collapsed revision
+  o  6:secret 'Collapsed revision
   |  * C
   |  * D'
-  o  5:draft 'H'
+  @  5:draft 'H'
   |
   | o  4:draft 'G'
   |/|
   o |  3:draft 'F'
   | |
@@ -266,17 +266,17 @@  Rebasing across null as ancestor
   
   $ hg rebase -s 1 -d tip
   saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  8: 'D'
+  o  8: 'D'
   |
   o  7: 'C'
   |
   o  6: 'B'
   |
-  o  5: 'extra branch'
+  @  5: 'extra branch'
   
   o  4: 'H'
   |
   | o  3: 'G'
   |/|
@@ -288,17 +288,17 @@  Rebasing across null as ancestor
   
 
   $ hg rebase -d 5 -s 7
   saved backup bundle to $TESTTMP/a5/.hg/strip-backup/13547172c9c0-backup.hg (glob)
   $ hg tglog
-  @  8: 'D'
+  o  8: 'D'
   |
   o  7: 'C'
   |
   | o  6: 'B'
   |/
-  o  5: 'extra branch'
+  @  5: 'extra branch'
   
   o  4: 'H'
   |
   | o  3: 'G'
   |/|
@@ -327,15 +327,15 @@  Verify that target is not selected as ex
 
   $ hg rebase -s 8 -d 7 --collapse --config ui.merge=internal:other
   saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  8: 'Collapsed revision
+  o  8: 'Collapsed revision
   |  * I
   |  * Merge
   |  * J'
-  o  7: 'H'
+  @  7: 'H'
   |
   | o  6: 'G'
   |/|
   o |  5: 'F'
   | |
diff --git a/tests/test-rebase-interruptions.t b/tests/test-rebase-interruptions.t
--- a/tests/test-rebase-interruptions.t
+++ b/tests/test-rebase-interruptions.t
@@ -108,17 +108,17 @@  Solve the conflict and go on:
 
   $ hg rebase --continue
   warning: new changesets detected on source branch, not stripping
 
   $ hg tglogp
-  @  7:draft 'C'
+  o  7:draft 'C'
   |
   | o  6:secret 'Extra'
   | |
   o |  5:draft 'B'
   | |
-  o |  4:draft 'E'
+  @ |  4:draft 'E'
   | |
   o |  3:draft 'D'
   | |
   | o  2:draft 'C'
   | |
diff --git a/tests/test-rebase-named-branches.t b/tests/test-rebase-named-branches.t
--- a/tests/test-rebase-named-branches.t
+++ b/tests/test-rebase-named-branches.t
@@ -145,19 +145,19 @@  Branch name containing a dash (issue3181
   
   $ hg rebase -b 'max(branch("dev-two"))' -d dev-one --keepbranches
   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  9: 'dev-two named branch' dev-two
+  o  9: 'dev-two named branch' dev-two
   |
   o  8: 'H'
   |
   | o  7: 'G'
   |/|
   o |  6: 'F'
   | |
-  o |  5: 'dev-one named branch' dev-one
+  @ |  5: 'dev-one named branch' dev-one
   | |
   | o  4: 'E'
   | |
   o |  3: 'D'
   | |
@@ -169,11 +169,11 @@  Branch name containing a dash (issue3181
   
   $ hg rebase -s 'max(branch("dev-one"))' -d 0 --keepbranches
   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  8: 'dev-two named branch' dev-two
+  o  8: 'dev-two named branch' dev-two
   |
   o  7: 'H'
   |
   | o  6: 'G'
   |/|
@@ -185,20 +185,20 @@  Branch name containing a dash (issue3181
   | |
   | o  2: 'C'
   | |
   | o  1: 'B'
   |/
-  o  0: 'A'
+  @  0: 'A'
   
 
 Rebasing descendant onto ancestor across different named branches
 
   $ hg rebase -s 1 -d 8 --keepbranches
   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  8: 'D'
+  o  8: 'D'
   |
   o  7: 'C'
   |
   o  6: 'B'
   |
@@ -210,21 +210,21 @@  Rebasing descendant onto ancestor across
   |/|
   o |  2: 'F'
   | |
   | o  1: 'E'
   |/
-  o  0: 'A'
+  @  0: 'A'
   
   $ hg rebase -s 4 -d 5
   abort: source is ancestor of destination
   [255]
 
   $ hg rebase -s 5 -d 4
   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  8: 'D'
+  o  8: 'D'
   |
   o  7: 'C'
   |
   o  6: 'B'
   |
@@ -236,8 +236,8 @@  Rebasing descendant onto ancestor across
   |/|
   o |  2: 'F'
   | |
   | o  1: 'E'
   |/
-  o  0: 'A'
+  @  0: 'A'
   
   $ cd ..
diff --git a/tests/test-rebase-newancestor.t b/tests/test-rebase-newancestor.t
--- a/tests/test-rebase-newancestor.t
+++ b/tests/test-rebase-newancestor.t
@@ -42,15 +42,15 @@ 
   merging a
   merging a
   saved backup bundle to $TESTTMP/repo/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  3: 'C'
+  o  3: 'C'
   |
   o  2: 'B'
   |
-  o  1: 'AD'
+  @  1: 'AD'
   |
   o  0: 'A'
   
 
   $ cd ..
diff --git a/tests/test-rebase-obsolete.t b/tests/test-rebase-obsolete.t
--- a/tests/test-rebase-obsolete.t
+++ b/tests/test-rebase-obsolete.t
@@ -124,13 +124,13 @@  set.
   $ hg graft 42ccdea3bb16 32af7686d403
   grafting revision 1
   grafting revision 3
   $ hg rebase  -s 42ccdea3bb16 -d .
   $ hg log -G
-  @  10:5ae4c968c6ac C
+  o  10:5ae4c968c6ac C
   |
-  o  9:08483444fef9 D
+  @  9:08483444fef9 D
   |
   o  8:8877864f1edb B
   |
   | o  7:02de42196ebe H
   | |
@@ -141,13 +141,13 @@  set.
   o |  4:9520eea781bc E
   |/
   o  0:cd010b8cd998 A
   
   $ hg log --hidden -G
-  @  10:5ae4c968c6ac C
+  o  10:5ae4c968c6ac C
   |
-  o  9:08483444fef9 D
+  @  9:08483444fef9 D
   |
   o  8:8877864f1edb B
   |
   | o  7:02de42196ebe H
   | |
@@ -207,15 +207,15 @@  More complex case were part of the rebas
   8877864f1edb05d0e07dc4ba77b67a80a7b86672 b1861c79d66ec3aa1b607ac3c9fb819e38b12238 0 {'date': '* *', 'user': 'test'} (glob)
   08483444fef91d6224f6655ee586a65d263ad34c 0 {'date': '* *', 'user': 'test'} (glob)
   5ae4c968c6aca831df823664e706c9d4aa34473d dd4be135457a404ce5541de427ae1d98a28f4acd 0 {'date': '* *', 'user': 'test'} (glob)
   $ hg log --rev 'divergent()'
   $ hg log -G
-  @  13:dd4be135457a C
+  o  13:dd4be135457a C
   |
   o  12:b1861c79d66e B
   |
-  o  11:cbc07f266875 D
+  @  11:cbc07f266875 D
   |
   o  7:02de42196ebe H
   |
   | o  6:eea13746799a G
   |/|
@@ -235,26 +235,26 @@  collapse rebase
   updating to branch default
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd collapse
   $ hg rebase  -s 42ccdea3bb16 -d eea13746799a --collapse
   $ hg log -G
-  @  8:4dc2197e807b Collapsed revision
+  o  8:4dc2197e807b Collapsed revision
   |
-  | o  7:02de42196ebe H
+  | @  7:02de42196ebe H
   | |
   o |  6:eea13746799a G
   |\|
   | o  5:24b6387c8c8c F
   | |
   o |  4:9520eea781bc E
   |/
   o  0:cd010b8cd998 A
   
   $ hg log --hidden -G
-  @  8:4dc2197e807b Collapsed revision
+  o  8:4dc2197e807b Collapsed revision
   |
-  | o  7:02de42196ebe H
+  | @  7:02de42196ebe H
   | |
   o |  6:eea13746799a G
   |\|
   | o  5:24b6387c8c8c F
   | |
@@ -288,34 +288,34 @@  not be rebased.
   3 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cd hidden
   $ hg rebase -s 5fddd98957c8 -d eea13746799a
   $ hg rebase -s 42ccdea3bb16 -d 02de42196ebe
   $ hg log -G
-  @  10:7c6027df6a99 B
+  o  10:7c6027df6a99 B
   |
   | o  9:cf44d2f5a9f4 D
   | |
   | o  8:e273c5e7d2d2 C
   | |
-  o |  7:02de42196ebe H
+  @ |  7:02de42196ebe H
   | |
   | o  6:eea13746799a G
   |/|
   o |  5:24b6387c8c8c F
   | |
   | o  4:9520eea781bc E
   |/
   o  0:cd010b8cd998 A
   
   $ hg log --hidden -G
-  @  10:7c6027df6a99 B
+  o  10:7c6027df6a99 B
   |
   | o  9:cf44d2f5a9f4 D
   | |
   | o  8:e273c5e7d2d2 C
   | |
-  o |  7:02de42196ebe H
+  @ |  7:02de42196ebe H
   | |
   | o  6:eea13746799a G
   |/|
   o |  5:24b6387c8c8c F
   | |
@@ -339,19 +339,19 @@  Test that rewriting leaving instability 
 
   $ hg log -r 'children(8)'
   9:cf44d2f5a9f4 D (no-eol)
   $ hg rebase -r 8
   $ hg log -G
-  @  11:0d8f238b634c C
+  o  11:0d8f238b634c C
   |
   o  10:7c6027df6a99 B
   |
   | o  9:cf44d2f5a9f4 D
   | |
   | x  8:e273c5e7d2d2 C
   | |
-  o |  7:02de42196ebe H
+  @ |  7:02de42196ebe H
   | |
   | o  6:eea13746799a G
   |/|
   o |  5:24b6387c8c8c F
   | |
@@ -364,15 +364,15 @@  Test that rewriting leaving instability 
 Test multiple root handling
 ------------------------------------
 
   $ hg rebase --dest 4 --rev '7+11+9'
   $ hg log -G
-  @  14:1e8370e38cca C
+  o  14:1e8370e38cca C
   |
   | o  13:102b4c1d889b D
   | |
-  o |  12:bfe264faf697 H
+  @ |  12:bfe264faf697 H
   |/
   | o  10:7c6027df6a99 B
   | |
   | x  7:02de42196ebe H
   | |
diff --git a/tests/test-rebase-parameters.t b/tests/test-rebase-parameters.t
--- a/tests/test-rebase-parameters.t
+++ b/tests/test-rebase-parameters.t
@@ -195,15 +195,15 @@  Specify only source (from 2 onto 8):
 
   $ hg rebase --source 'desc("C")'
   saved backup bundle to $TESTTMP/a4/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  8: 'D'
+  o  8: 'D'
   |
   o  7: 'C'
   |
-  o  6: 'I'
+  @  6: 'I'
   |
   o  5: 'H'
   |
   | o  4: 'G'
   |/|
@@ -255,17 +255,17 @@  Specify only base (from 1 onto 8):
 
   $ hg rebase --base 'desc("D")'
   saved backup bundle to $TESTTMP/a6/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  8: 'D'
+  o  8: 'D'
   |
   o  7: 'C'
   |
   o  6: 'B'
   |
-  o  5: 'I'
+  @  5: 'I'
   |
   o  4: 'H'
   |
   | o  3: 'G'
   |/|
@@ -285,15 +285,15 @@  Specify source and dest (from 2 onto 7):
 
   $ hg rebase --source 2 --dest 7
   saved backup bundle to $TESTTMP/a7/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  8: 'D'
+  o  8: 'D'
   |
   o  7: 'C'
   |
-  | o  6: 'I'
+  | @  6: 'I'
   |/
   o  5: 'H'
   |
   | o  4: 'G'
   |/|
@@ -315,17 +315,17 @@  Specify base and dest (from 1 onto 7):
 
   $ hg rebase --base 3 --dest 7
   saved backup bundle to $TESTTMP/a8/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  8: 'D'
+  o  8: 'D'
   |
   o  7: 'C'
   |
   o  6: 'B'
   |
-  | o  5: 'I'
+  | @  5: 'I'
   |/
   o  4: 'H'
   |
   | o  3: 'G'
   |/|
@@ -345,15 +345,15 @@  Specify only revs (from 2 onto 8)
 
   $ hg rebase --rev 'desc("C")::'
   saved backup bundle to $TESTTMP/a9/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  8: 'D'
+  o  8: 'D'
   |
   o  7: 'C'
   |
-  o  6: 'I'
+  @  6: 'I'
   |
   o  5: 'H'
   |
   | o  4: 'G'
   |/|
diff --git a/tests/test-rebase-scenario-global.t b/tests/test-rebase-scenario-global.t
--- a/tests/test-rebase-scenario-global.t
+++ b/tests/test-rebase-scenario-global.t
@@ -50,13 +50,13 @@  D onto H - simple rebase:
 
   $ hg rebase -s 3 -d 7
   saved backup bundle to $TESTTMP/a1/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  7: 'D'
+  o  7: 'D'
   |
-  o  6: 'H'
+  @  6: 'H'
   |
   | o  5: 'G'
   |/|
   o |  4: 'F'
   | |
@@ -78,13 +78,13 @@  D onto F - intermediate point:
 
   $ hg rebase -s 3 -d 5
   saved backup bundle to $TESTTMP/a2/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  7: 'D'
+  o  7: 'D'
   |
-  | o  6: 'H'
+  | @  6: 'H'
   |/
   | o  5: 'G'
   |/|
   o |  4: 'F'
   | |
@@ -106,13 +106,13 @@  E onto H - skip of G:
 
   $ hg rebase -s 4 -d 7
   saved backup bundle to $TESTTMP/a3/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @  6: 'E'
+  o  6: 'E'
   |
-  o  5: 'H'
+  @  5: 'H'
   |
   o  4: 'F'
   |
   | o  3: 'D'
   | |
@@ -158,13 +158,13 @@  G onto H - merged revision having a pare
 
   $ hg rebase -s 6 -d 7
   saved backup bundle to $TESTTMP/a5/.hg/strip-backup/*-backup.hg (glob)
 
   $ hg tglog
-  @    7: 'G'
+  o    7: 'G'
   |\
-  | o  6: 'H'
+  | @  6: 'H'
   | |
   | o  5: 'F'
   | |
   o |  4: 'E'
   |/
@@ -254,15 +254,15 @@  F onto G - rebase onto a descendant:
 C onto A - rebase onto an ancestor:
 
   $ hg rebase -d 0 -s 2
   saved backup bundle to $TESTTMP/a7/.hg/strip-backup/5fddd98957c8-backup.hg (glob)
   $ hg tglog
-  @  7: 'D'
+  o  7: 'D'
   |
   o  6: 'C'
   |
-  | o  5: 'H'
+  | @  5: 'H'
   | |
   | | o  4: 'G'
   | |/|
   | o |  3: 'F'
   |/ /
@@ -358,11 +358,11 @@  Source on have two descendant heads but 
   abort: can't remove original changesets with unrebased descendants
   (use --keep to keep original changesets)
   [255]
   $ hg rebase -r '2::8' -d 1 --keep
   $ hg tglog
-  @  13: 'I'
+  o  13: 'I'
   |
   o  12: 'H'
   |
   o  11: 'G'
   |
@@ -399,11 +399,11 @@  Base on have one descendant heads we ask
   abort: can't remove original changesets with unrebased descendants
   (use --keep to keep original changesets)
   [255]
   $ hg rebase -r '3::8' -d 1 --keep
   $ hg tglog
-  @  12: 'I'
+  o  12: 'I'
   |
   o  11: 'H'
   |
   o  10: 'G'
   |
@@ -438,11 +438,11 @@  rebase subset
   abort: can't remove original changesets with unrebased descendants
   (use --keep to keep original changesets)
   [255]
   $ hg rebase -r '3::7' -d 1 --keep
   $ hg tglog
-  @  11: 'H'
+  o  11: 'H'
   |
   o  10: 'G'
   |
   o  9: 'D'
   |
@@ -475,11 +475,11 @@  rebase subset with multiple head
   abort: can't remove original changesets with unrebased descendants
   (use --keep to keep original changesets)
   [255]
   $ hg rebase -r '3::(7+5)' -d 1 --keep
   $ hg tglog
-  @  13: 'H'
+  o  13: 'H'
   |
   o  12: 'G'
   |
   | o  11: 'F'
   | |
@@ -515,11 +515,11 @@  rebase on ancestor with revset
   $ hg clone -q -u . ah ah5
   $ cd ah5
   $ hg rebase -r '6::' -d 2
   saved backup bundle to $TESTTMP/ah5/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
   $ hg tglog
-  @  8: 'I'
+  o  8: 'I'
   |
   o  7: 'H'
   |
   o  6: 'G'
   |
@@ -545,11 +545,11 @@  We would expect heads are I, F if it was
   $ hg clone -q -u . ah ah6
   $ cd ah6
   $ hg rebase -r '(4+6)::' -d 1
   saved backup bundle to $TESTTMP/ah6/.hg/strip-backup/3d8a618087a7-backup.hg (glob)
   $ hg tglog
-  @  8: 'I'
+  o  8: 'I'
   |
   o  7: 'H'
   |
   o  6: 'G'
   |