Mercurial > hg
comparison tests/test-rebase-emptycommit.t @ 34354:2f427b57bf90 stable 4.3.3
rebase: move bookmarks with --keep (issue5682)
This is a regression caused by 3b7cb3d17137. We have documented the behavior
in rebase help:
Rebase will destroy original commits unless you use "--keep". It will
also move your bookmarks (even if you do).
So let's restore the old behavior.
It is done by changing `scmutil.cleanupnodes` to accept more information so
a node could have different "movement destination" from "successors". It
also helps simplifying the callsite as a side effect - the special bookmark
movement logic in rebase is removed.
Differential Revision: https://phab.mercurial-scm.org/D727
author | Jun Wu <quark@fb.com> |
---|---|
date | Mon, 18 Sep 2017 10:54:00 -0700 |
parents | 52f82e7d6a7e |
children | f61f5af5ed31 |
comparison
equal
deleted
inserted
replaced
34353:2dbd6d259cd2 | 34354:2f427b57bf90 |
---|---|
45 | | | 45 | | |
46 o | 1 B | 46 o | 1 B |
47 |/ | 47 |/ |
48 o 0 A | 48 o 0 A |
49 | 49 |
50 With --keep, bookmark should not move | 50 With --keep, bookmark should move |
51 | 51 |
52 $ hg rebase -r 3+4 -d E --keep | 52 $ hg rebase -r 3+4 -d E --keep |
53 rebasing 3:e7b3f00ed42e "D" (BOOK-D) | 53 rebasing 3:e7b3f00ed42e "D" (BOOK-D) |
54 note: rebase of 3:e7b3f00ed42e created no changes to commit | 54 note: rebase of 3:e7b3f00ed42e created no changes to commit |
55 rebasing 4:69a34c08022a "E" (BOOK-E) | 55 rebasing 4:69a34c08022a "E" (BOOK-E) |
56 note: rebase of 4:69a34c08022a created no changes to commit | 56 note: rebase of 4:69a34c08022a created no changes to commit |
57 $ hg log -G -T '{rev} {desc} {bookmarks}' | 57 $ hg log -G -T '{rev} {desc} {bookmarks}' |
58 o 7 E | 58 o 7 E BOOK-D BOOK-E |
59 | | 59 | |
60 o 6 D | 60 o 6 D |
61 | | 61 | |
62 | o 5 F BOOK-F | 62 | o 5 F BOOK-F |
63 | | | 63 | | |
64 | o 4 E BOOK-E | 64 | o 4 E |
65 | | | 65 | | |
66 | o 3 D BOOK-D | 66 | o 3 D |
67 | | | 67 | | |
68 | o 2 C BOOK-C | 68 | o 2 C BOOK-C |
69 | | | 69 | | |
70 o | 1 B | 70 o | 1 B |
71 |/ | 71 |/ |
72 o 0 A | 72 o 0 A |
73 | 73 |
74 Move D and E back for the next test | |
75 | |
76 $ hg bookmark BOOK-D -fqir 3 | |
77 $ hg bookmark BOOK-E -fqir 4 | |
78 | |
74 Bookmark is usually an indication of a head. For changes that are introduced by | 79 Bookmark is usually an indication of a head. For changes that are introduced by |
75 an ancestor of bookmark B, after moving B to B-NEW, the changes are ideally | 80 an ancestor of bookmark B, after moving B to B-NEW, the changes are ideally |
76 still introduced by an ancestor of changeset on B-NEW. In the below case, | 81 still introduced by an ancestor of changeset on B-NEW. In the below case, |
77 "BOOK-D", and "BOOK-E" include changes introduced by "C". | 82 "BOOK-D", and "BOOK-E" include changes introduced by "C". |
78 | 83 |