| 1 |
$ echo "[extensions]" >> $HGRCPATH |
| 2 |
$ echo "rebase=" >> $HGRCPATH |
| 3 |
|
| 4 |
initialize repository |
| 5 |
|
| 6 |
$ hg init repo |
| 7 |
$ cd repo |
| 8 |
|
| 9 |
$ echo 'a' > a |
| 10 |
$ hg ci -A -m "0" |
| 11 |
adding a |
| 12 |
|
| 13 |
$ echo 'b' > b |
| 14 |
$ hg ci -A -m "1" |
| 15 |
adding b |
| 16 |
|
| 17 |
$ hg up 0 |
| 18 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 19 |
$ echo 'c' > c |
| 20 |
$ hg ci -A -m "2" |
| 21 |
adding c |
| 22 |
created new head |
| 23 |
|
| 24 |
$ echo 'd' > d |
| 25 |
$ hg ci -A -m "3" |
| 26 |
adding d |
| 27 |
|
| 28 |
$ hg bookmark -r 1 one |
| 29 |
$ hg bookmark -r 3 two |
| 30 |
$ hg up -q two |
| 31 |
|
| 32 |
bookmark list |
| 33 |
|
| 34 |
$ hg bookmark |
| 35 |
one 1:925d80f479bb |
| 36 |
* two 3:2ae46b1d99a7 |
| 37 |
|
| 38 |
rebase |
| 39 |
|
| 40 |
$ hg rebase -s two -d one |
| 41 |
rebasing 3:2ae46b1d99a7 two tip "3" |
| 42 |
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/2ae46b1d99a7-e6b057bc-rebase.hg |
| 43 |
|
| 44 |
$ hg log |
| 45 |
changeset: 3:42e5ed2cdcf4 |
| 46 |
bookmark: two |
| 47 |
tag: tip |
| 48 |
parent: 1:925d80f479bb |
| 49 |
user: test |
| 50 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 51 |
summary: 3 |
| 52 |
|
| 53 |
changeset: 2:db815d6d32e6 |
| 54 |
parent: 0:f7b1eb17ad24 |
| 55 |
user: test |
| 56 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 57 |
summary: 2 |
| 58 |
|
| 59 |
changeset: 1:925d80f479bb |
| 60 |
bookmark: one |
| 61 |
user: test |
| 62 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 63 |
summary: 1 |
| 64 |
|
| 65 |
changeset: 0:f7b1eb17ad24 |
| 66 |
user: test |
| 67 |
date: Thu Jan 01 00:00:00 1970 +0000 |
| 68 |
summary: 0 |
| 69 |
|
| 70 |
aborted rebase should restore active bookmark. |
| 71 |
|
| 72 |
$ hg up 1 |
| 73 |
0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
| 74 |
(leaving bookmark two) |
| 75 |
$ echo 'e' > d |
| 76 |
$ hg ci -A -m "4" |
| 77 |
adding d |
| 78 |
created new head |
| 79 |
$ hg bookmark three |
| 80 |
$ hg rebase -s three -d two |
| 81 |
rebasing 4:dd7c838e8362 three tip "4" |
| 82 |
merging d |
| 83 |
warning: conflicts while merging d! (edit, then use 'hg resolve --mark') |
| 84 |
unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') |
| 85 |
[240] |
| 86 |
$ hg rebase --abort |
| 87 |
rebase aborted |
| 88 |
$ hg bookmark |
| 89 |
one 1:925d80f479bb |
| 90 |
* three 4:dd7c838e8362 |
| 91 |
two 3:42e5ed2cdcf4 |
| 92 |
|
| 93 |
after aborted rebase, restoring a bookmark that has been removed should not fail |
| 94 |
|
| 95 |
$ hg rebase -s three -d two |
| 96 |
rebasing 4:dd7c838e8362 three tip "4" |
| 97 |
merging d |
| 98 |
warning: conflicts while merging d! (edit, then use 'hg resolve --mark') |
| 99 |
unresolved conflicts (see 'hg resolve', then 'hg rebase --continue') |
| 100 |
[240] |
| 101 |
$ hg bookmark -d three |
| 102 |
$ hg rebase --abort |
| 103 |
rebase aborted |
| 104 |
$ hg bookmark |
| 105 |
one 1:925d80f479bb |
| 106 |
two 3:42e5ed2cdcf4 |