Mercurial > public > mercurial-scm > hg
diff tests/test-bookmarks.t @ 17264:ec7b9bec19c9 stable
strip: move bookmarks to nearest ancestor rather than '.'
If you've got this graph:
0-1-2
\
3
and 3 is checked out, 2 is bookmarked with "broken", and you do "hg
strip 2", the bookmark will move to 3, not 1. That's always struck me
as a bug.
This change makes bookmarks move to the tipmost ancestor of
the stripped set rather than the currently-checked-out revision, which
is what I always expected should happen.
author | Augie Fackler <raf@durin42.com> |
---|---|
date | Thu, 26 Jul 2012 16:57:50 -0500 |
parents | da55d8a77390 |
children | 6e4b962600a3 4a07d2ff7c66 |
line wrap: on
line diff
--- a/tests/test-bookmarks.t Fri Jul 27 12:33:48 2012 -0500 +++ b/tests/test-bookmarks.t Thu Jul 26 16:57:50 2012 -0500 @@ -390,3 +390,70 @@ $ echo "925d80f479bc z" > .hg/bookmarks $ hg book no bookmarks set + +test stripping a non-checked-out but bookmarked revision + + $ hg --config extensions.graphlog= log --graph + o changeset: 4:9ba5f110a0b3 + | branch: test + | tag: tip + | parent: 2:db815d6d32e6 + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: y + | + | @ changeset: 3:125c9a1d6df6 + |/ user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: x + | + o changeset: 2:db815d6d32e6 + | parent: 0:f7b1eb17ad24 + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: 2 + | + | o changeset: 1:925d80f479bb + |/ user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: 1 + | + o changeset: 0:f7b1eb17ad24 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: 0 + + $ hg book should-end-on-two + $ hg co --clean 4 + 1 files updated, 0 files merged, 1 files removed, 0 files unresolved + $ hg book four + $ hg --config extensions.mq= strip 3 + saved backup bundle to * (glob) +should-end-on-two should end up pointing to revision 2, as that's the +tipmost surviving ancestor of the stripped revision. + $ hg --config extensions.graphlog= log --graph + @ changeset: 3:9ba5f110a0b3 + | branch: test + | bookmark: four + | tag: tip + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: y + | + o changeset: 2:db815d6d32e6 + | bookmark: should-end-on-two + | parent: 0:f7b1eb17ad24 + | user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: 2 + | + | o changeset: 1:925d80f479bb + |/ user: test + | date: Thu Jan 01 00:00:00 1970 +0000 + | summary: 1 + | + o changeset: 0:f7b1eb17ad24 + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: 0 +