sapling/tests/test-fb-hgext-fbamend-hide.t
Mateusz Kwapich e846e43ff2 print the former bookmark target when removing bookmark
Summary: This makes it much easier to restore it manually.

Reviewed By: ryanmce

Differential Revision: D7585131

fbshipit-source-id: f7ee14b2411a73ab51563653932c48d29b36e7a3
2018-04-13 21:51:54 -07:00

170 lines
3.2 KiB
Perl

$ cat >> $HGRCPATH << EOF
> [extensions]
> fbamend=
> inhibit=
> undo =
> [experimental]
> evolution = createmarkers, allowunstable
> EOF
Create repo
$ hg init
$ hg debugdrawdag <<'EOS'
> E
> |
> C D
> |/
> B
> |
> A
> EOS
$ rm .hg/localtags
$ hg book -r 2 cat
$ hg book -r 1 dog
$ hg update 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg log -G -T '{rev} {desc} {bookmarks}\n'
o 4 E
|
| o 3 D
| |
o | 2 C cat
|/
o 1 B dog
|
@ 0 A
Hide a single commit
$ hg hide 3
hiding commit be0ef73c17ad "D"
1 changesets hidden
hint[undo]: you can undo this using the `hg undo` command
hint[hint-ack]: use 'hg hint --ack undo' to silence these hints
$ hg log -G -T '{rev} {desc} {bookmarks}\n'
o 4 E
|
o 2 C cat
|
o 1 B dog
|
@ 0 A
Hide multiple commits with bookmarks on them, hide wc parent
$ hg update 1
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg hide .
hiding commit 112478962961 "B"
hiding commit 26805aba1e60 "C"
hiding commit 78d2dca436b2 "E"
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
working directory now at 426bada5c675
3 changesets hidden
removing bookmark "cat (was at: 26805aba1e60)"
removing bookmark "dog (was at: 112478962961)"
2 bookmarks removed
hint[undo]: you can undo this using the `hg undo` command
hint[hint-ack]: use 'hg hint --ack undo' to silence these hints
$ hg log -G -T '{rev} {desc} {bookmarks}\n'
@ 0 A
Unhide stuff
$ hg unhide 2
$ hg log -G -T '{rev} {desc} {bookmarks}\n'
o 2 C
|
o 1 B
|
@ 0 A
$ hg unhide -r 4 -r 3
$ hg log -G -T '{rev} {desc} {bookmarks}\n'
o 4 E
|
| o 3 D
| |
o | 2 C
|/
o 1 B
|
@ 0 A
hg hide --cleanup tests
$ hg update 4
3 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo f > f
$ hg add f
$ hg commit -d "0 0" -m F
$ hg update 4
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ hg amend --no-rebase -m E2 -d "0 0"
hint[amend-restack]: descendants of 78d2dca436b2 are left behind - use 'hg restack' to rebase them
hint[hint-ack]: use 'hg hint --ack amend-restack' to silence these hints
$ hg log -G -T '{rev} {desc} {bookmarks}\n'
@ 6 E2
|
| o 5 F
| |
| x 4 E
|/
| o 3 D
| |
o | 2 C
|/
o 1 B
|
o 0 A
$ hg hide -c
abort: nothing to hide
[255]
$ hg hide -c -r .
abort: --rev and --cleanup are incompatible
[255]
$ hg --config extensions.rebase= rebase -s 5 -d 6
rebasing 5:1f7934a9b4de "F"
$ hg book -r 5 alive --hidden
$ hg log -G -T '{rev} {desc} {bookmarks}\n'
o 7 F
|
@ 6 E2
|
| x 5 F alive
| |
| x 4 E
|/
| o 3 D
| |
o | 2 C
|/
o 1 B
|
o 0 A
$ hg hide --cleanup
hiding commit 78d2dca436b2 "E"
hiding commit 1f7934a9b4de "F"
2 changesets hidden
removing bookmark "alive (was at: 1f7934a9b4de)"
1 bookmarks removed
hint[undo]: you can undo this using the `hg undo` command
hint[hint-ack]: use 'hg hint --ack undo' to silence these hints
$ hg log -G -T '{rev} {desc} {bookmarks}\n'
o 7 F
|
@ 6 E2
|
| o 3 D
| |
o | 2 C
|/
o 1 B
|
o 0 A