Mercurial > hg
comparison tests/test-rebase-bookmarks.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 | 3b7cb3d17137 |
children | f61f5af5ed31 |
comparison
equal
deleted
inserted
replaced
34353:2dbd6d259cd2 | 34354:2f427b57bf90 |
---|---|
1 $ cat >> $HGRCPATH <<EOF | 1 $ cat >> $HGRCPATH <<EOF |
2 > [extensions] | 2 > [extensions] |
3 > rebase= | 3 > rebase= |
4 > drawdag=$TESTDIR/drawdag.py | |
4 > | 5 > |
5 > [phases] | 6 > [phases] |
6 > publish=False | 7 > publish=False |
7 > | 8 > |
8 > [alias] | 9 > [alias] |
208 $ hg rebase -r '"bisect"^^::"bisect"^' -r bisect -d Z | 209 $ hg rebase -r '"bisect"^^::"bisect"^' -r bisect -d Z |
209 rebasing 5:345c90f326a4 "bisect" | 210 rebasing 5:345c90f326a4 "bisect" |
210 rebasing 6:f677a2907404 "bisect2" | 211 rebasing 6:f677a2907404 "bisect2" |
211 rebasing 7:325c16001345 "bisect3" (tip bisect) | 212 rebasing 7:325c16001345 "bisect3" (tip bisect) |
212 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/345c90f326a4-b4840586-rebase.hg (glob) | 213 saved backup bundle to $TESTTMP/a3/.hg/strip-backup/345c90f326a4-b4840586-rebase.hg (glob) |
214 | |
215 Bookmark and working parent get moved even if --keep is set (issue5682) | |
216 | |
217 $ hg init $TESTTMP/book-keep | |
218 $ cd $TESTTMP/book-keep | |
219 $ hg debugdrawdag <<'EOS' | |
220 > B C | |
221 > |/ | |
222 > A | |
223 > EOS | |
224 $ eval `hg tags -T 'hg bookmark -ir {node} {tag};\n' | grep -v tip` | |
225 $ rm .hg/localtags | |
226 $ hg up -q B | |
227 $ hg tglog | |
228 o 2: 'C' bookmarks: C | |
229 | | |
230 | @ 1: 'B' bookmarks: B | |
231 |/ | |
232 o 0: 'A' bookmarks: A | |
233 | |
234 $ hg rebase -r B -d C --keep | |
235 rebasing 1:112478962961 "B" (B) | |
236 $ hg tglog | |
237 @ 3: 'B' bookmarks: B | |
238 | | |
239 o 2: 'C' bookmarks: C | |
240 | | |
241 | o 1: 'B' bookmarks: | |
242 |/ | |
243 o 0: 'A' bookmarks: A | |
244 | |
245 |