##// END OF EJS Templates
rebase: clarify that commits that become empty are skipped...
rebase: clarify that commits that become empty are skipped Our message just said that it created no changes, but we didn't explicitly say that that meant that the the commit was not rebased. It also wasn't clear why it created no changes, so this patch also clarifies that that was because the changes were already in the destination. Differential Revision: https://phab.mercurial-scm.org/D5395

File last commit:

r40900:4edd427f default
r40900:4edd427f default
Show More
test-rebase-emptycommit.t
207 lines | 4.0 KiB | text/troff | Tads3Lexer
/ tests / test-rebase-emptycommit.t
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 $ cat >> $HGRCPATH<<EOF
> [extensions]
> rebase=
> drawdag=$TESTDIR/drawdag.py
> EOF
$ hg init non-merge
$ cd non-merge
$ hg debugdrawdag<<'EOS'
> F
> |
> E
> |
> D
> |
> B C
> |/
> A
> EOS
$ for i in C D E F; do
> hg bookmark -r $i -i BOOK-$i
> done
$ hg debugdrawdag<<'EOS'
> E
> |
> D
> |
> B
> EOS
$ hg log -G -T '{rev} {desc} {bookmarks}'
o 7 E
|
o 6 D
|
| o 5 F BOOK-F
| |
| o 4 E BOOK-E
| |
| o 3 D BOOK-D
| |
| o 2 C BOOK-C
| |
o | 1 B
|/
o 0 A
Jun Wu
rebase: move bookmarks with --keep (issue5682)...
r34364 With --keep, bookmark should move
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591
$ hg rebase -r 3+4 -d E --keep
rebasing 3:e7b3f00ed42e "D" (BOOK-D)
Martin von Zweigbergk
rebase: clarify that commits that become empty are skipped...
r40900 note: not rebasing 3:e7b3f00ed42e "D" (BOOK-D), its destination already has all its changes
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 rebasing 4:69a34c08022a "E" (BOOK-E)
Martin von Zweigbergk
rebase: clarify that commits that become empty are skipped...
r40900 note: not rebasing 4:69a34c08022a "E" (BOOK-E), its destination already has all its changes
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 $ hg log -G -T '{rev} {desc} {bookmarks}'
Jun Wu
rebase: move bookmarks with --keep (issue5682)...
r34364 o 7 E BOOK-D BOOK-E
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 |
o 6 D
|
| o 5 F BOOK-F
| |
Jun Wu
rebase: move bookmarks with --keep (issue5682)...
r34364 | o 4 E
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 | |
Jun Wu
rebase: move bookmarks with --keep (issue5682)...
r34364 | o 3 D
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 | |
| o 2 C BOOK-C
| |
o | 1 B
|/
o 0 A
Jun Wu
rebase: move bookmarks with --keep (issue5682)...
r34364 Move D and E back for the next test
$ hg bookmark BOOK-D -fqir 3
$ hg bookmark BOOK-E -fqir 4
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 Bookmark is usually an indication of a head. For changes that are introduced by
an ancestor of bookmark B, after moving B to B-NEW, the changes are ideally
still introduced by an ancestor of changeset on B-NEW. In the below case,
"BOOK-D", and "BOOK-E" include changes introduced by "C".
$ hg rebase -s 2 -d E
Martin von Zweigbergk
rebase: also include other namespaces in changeset description...
r34291 rebasing 2:dc0947a82db8 "C" (BOOK-C C)
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 rebasing 3:e7b3f00ed42e "D" (BOOK-D)
Martin von Zweigbergk
rebase: clarify that commits that become empty are skipped...
r40900 note: not rebasing 3:e7b3f00ed42e "D" (BOOK-D), its destination already has all its changes
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 rebasing 4:69a34c08022a "E" (BOOK-E)
Martin von Zweigbergk
rebase: clarify that commits that become empty are skipped...
r40900 note: not rebasing 4:69a34c08022a "E" (BOOK-E), its destination already has all its changes
Martin von Zweigbergk
rebase: also include other namespaces in changeset description...
r34291 rebasing 5:6b2aeab91270 "F" (BOOK-F F)
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 saved backup bundle to $TESTTMP/non-merge/.hg/strip-backup/dc0947a82db8-52bb4973-rebase.hg
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 $ hg log -G -T '{rev} {desc} {bookmarks}'
o 5 F BOOK-F
|
o 4 C BOOK-C BOOK-D BOOK-E
|
o 3 E
|
o 2 D
|
o 1 B
|
o 0 A
Merge and its ancestors all become empty
$ hg init $TESTTMP/merge1
$ cd $TESTTMP/merge1
$ hg debugdrawdag<<'EOS'
> E
> /|
> B C D
> \|/
> A
> EOS
$ for i in C D E; do
> hg bookmark -r $i -i BOOK-$i
> done
$ hg debugdrawdag<<'EOS'
> H
> |
> D
> |
> C
> |
> B
> EOS
$ hg rebase -r '(A::)-(B::)-A' -d H
rebasing 2:dc0947a82db8 "C" (BOOK-C)
Martin von Zweigbergk
rebase: clarify that commits that become empty are skipped...
r40900 note: not rebasing 2:dc0947a82db8 "C" (BOOK-C), its destination already has all its changes
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 rebasing 3:b18e25de2cf5 "D" (BOOK-D)
Martin von Zweigbergk
rebase: clarify that commits that become empty are skipped...
r40900 note: not rebasing 3:b18e25de2cf5 "D" (BOOK-D), its destination already has all its changes
Martin von Zweigbergk
rebase: also include other namespaces in changeset description...
r34291 rebasing 4:86a1f6686812 "E" (BOOK-E E)
Martin von Zweigbergk
rebase: clarify that commits that become empty are skipped...
r40900 note: not rebasing 4:86a1f6686812 "E" (BOOK-E E), its destination already has all its changes
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 saved backup bundle to $TESTTMP/merge1/.hg/strip-backup/b18e25de2cf5-1fd0a4ba-rebase.hg
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591
$ hg log -G -T '{rev} {desc} {bookmarks}'
o 4 H BOOK-C BOOK-D BOOK-E
|
o 3 D
|
o 2 C
|
o 1 B
|
o 0 A
Part of ancestors of a merge become empty
$ hg init $TESTTMP/merge2
$ cd $TESTTMP/merge2
$ hg debugdrawdag<<'EOS'
> G
> /|
> E F
> | |
> B C D
> \|/
> A
> EOS
$ for i in C D E F G; do
> hg bookmark -r $i -i BOOK-$i
> done
$ hg debugdrawdag<<'EOS'
> H
> |
> F
> |
> C
> |
> B
> EOS
$ hg rebase -r '(A::)-(B::)-A' -d H
rebasing 2:dc0947a82db8 "C" (BOOK-C)
Martin von Zweigbergk
rebase: clarify that commits that become empty are skipped...
r40900 note: not rebasing 2:dc0947a82db8 "C" (BOOK-C), its destination already has all its changes
Martin von Zweigbergk
rebase: also include other namespaces in changeset description...
r34291 rebasing 3:b18e25de2cf5 "D" (BOOK-D D)
rebasing 4:03ca77807e91 "E" (BOOK-E E)
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591 rebasing 5:ad6717a6a58e "F" (BOOK-F)
Martin von Zweigbergk
rebase: clarify that commits that become empty are skipped...
r40900 note: not rebasing 5:ad6717a6a58e "F" (BOOK-F), its destination already has all its changes
Martin von Zweigbergk
rebase: also include other namespaces in changeset description...
r34291 rebasing 6:c58e8bdac1f4 "G" (BOOK-G G)
Matt Harbison
tests: remove (glob) annotations that were only for '\' matches...
r35394 saved backup bundle to $TESTTMP/merge2/.hg/strip-backup/b18e25de2cf5-2d487005-rebase.hg
Jun Wu
rebase: move bookmark to destination for commits becoming empty (issue5627)...
r33591
$ hg log -G -T '{rev} {desc} {bookmarks}'
o 7 G BOOK-G
|\
| o 6 E BOOK-E
| |
o | 5 D BOOK-D BOOK-F
|/
o 4 H BOOK-C
|
o 3 F
|
o 2 C
|
o 1 B
|
o 0 A