test-backout.t
823 lines
| 18.0 KiB
| text/troff
|
Tads3Lexer
/ tests / test-backout.t
Martin Geisler
|
r11856 | $ hg init basic | ||
$ cd basic | ||||
Matt Mackall
|
r12328 | should complain | ||
Martin Geisler
|
r11856 | |||
$ hg backout | ||||
abort: please specify a revision to backout | ||||
Matt Mackall
|
r12316 | [255] | ||
Martin Geisler
|
r11856 | $ hg backout -r 0 0 | ||
abort: please specify just one revision | ||||
Matt Mackall
|
r12316 | [255] | ||
Martin Geisler
|
r11856 | |||
Matt Mackall
|
r12328 | basic operation | ||
FUJIWARA Katsunori
|
r21413 | (this also tests that editor is invoked if the commit message is not | ||
specified explicitly) | ||||
Martin Geisler
|
r11856 | |||
$ echo a > a | ||||
$ hg commit -d '0 0' -A -m a | ||||
adding a | ||||
$ echo b >> a | ||||
$ hg commit -d '1 0' -m b | ||||
FUJIWARA Katsunori
|
r21413 | $ hg status --rev tip --rev "tip^1" | ||
M a | ||||
$ HGEDITOR=cat hg backout -d '2 0' tip --tool=true | ||||
Martin Geisler
|
r11856 | reverting a | ||
FUJIWARA Katsunori
|
r21413 | Backed out changeset a820f4f40a57 | ||
HG: Enter commit message. Lines beginning with 'HG:' are removed. | ||||
HG: Leave message empty to abort commit. | ||||
HG: -- | ||||
HG: user: test | ||||
HG: branch 'default' | ||||
HG: changed a | ||||
Martin Geisler
|
r11856 | changeset 2:2929462c3dff backs out changeset 1:a820f4f40a57 | ||
$ cat a | ||||
a | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 2:2929462c3dff tip | ||||
Backed out changeset a820f4f40a57 | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 3 draft | ||
Martin Geisler
|
r11856 | |||
Mateusz Kwapich
|
r23615 | commit option | ||
$ cd .. | ||||
$ hg init commit | ||||
$ cd commit | ||||
$ echo tomatoes > a | ||||
$ hg add a | ||||
$ hg commit -d '0 0' -m tomatoes | ||||
$ echo chair > b | ||||
$ hg add b | ||||
$ hg commit -d '1 0' -m chair | ||||
$ echo grapes >> a | ||||
$ hg commit -d '2 0' -m grapes | ||||
Ruslan Sayfutdinov
|
r27890 | $ hg backout -d '4 0' 1 --tool=:fail | ||
Mateusz Kwapich
|
r23615 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||
changeset 3:1c2161e97c0a backs out changeset 1:22cb4f70d813 | ||||
$ hg summary | ||||
parent: 3:1c2161e97c0a tip | ||||
Backed out changeset 22cb4f70d813 | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 4 draft | ||
Mateusz Kwapich
|
r23615 | |||
$ echo ypples > a | ||||
$ hg commit -d '5 0' -m ypples | ||||
Ruslan Sayfutdinov
|
r27890 | $ hg backout -d '6 0' 2 --tool=:fail | ||
Mateusz Kwapich
|
r23615 | 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||
use 'hg resolve' to retry unresolved file merges | ||||
[1] | ||||
$ hg summary | ||||
parent: 4:ed99997b793d tip | ||||
ypples | ||||
branch: default | ||||
commit: 1 unresolved (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 5 draft | ||
Martin von Zweigbergk
|
r44818 | $ hg log -G | ||
@ changeset: 4:ed99997b793d | ||||
| tag: tip | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:05 1970 +0000 | ||||
| summary: ypples | ||||
| | ||||
o changeset: 3:1c2161e97c0a | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:04 1970 +0000 | ||||
| summary: Backed out changeset 22cb4f70d813 | ||||
| | ||||
o changeset: 2:a8c6e511cfee | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:02 1970 +0000 | ||||
| summary: grapes | ||||
| | ||||
Martin von Zweigbergk
|
r44819 | % changeset: 1:22cb4f70d813 | ||
Martin von Zweigbergk
|
r44818 | | user: test | ||
| date: Thu Jan 01 00:00:01 1970 +0000 | ||||
| summary: chair | ||||
| | ||||
o changeset: 0:a5cb2dde5805 | ||||
user: test | ||||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: tomatoes | ||||
Mateusz Kwapich
|
r23615 | |||
Matt Mackall
|
r12328 | file that was removed is recreated | ||
FUJIWARA Katsunori
|
r21413 | (this also tests that editor is not invoked if the commit message is | ||
specified explicitly) | ||||
Martin Geisler
|
r11856 | |||
$ cd .. | ||||
$ hg init remove | ||||
$ cd remove | ||||
$ echo content > a | ||||
$ hg commit -d '0 0' -A -m a | ||||
adding a | ||||
$ hg rm a | ||||
$ hg commit -d '1 0' -m b | ||||
FUJIWARA Katsunori
|
r21413 | $ HGEDITOR=cat hg backout -d '2 0' tip --tool=true -m "Backed out changeset 76862dcce372" | ||
Martin Geisler
|
r11856 | adding a | ||
changeset 2:de31bdc76c0d backs out changeset 1:76862dcce372 | ||||
$ cat a | ||||
content | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 2:de31bdc76c0d tip | ||||
Backed out changeset 76862dcce372 | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 3 draft | ||
Martin Geisler
|
r11856 | |||
Matt Mackall
|
r12328 | backout of backout is as if nothing happened | ||
Martin Geisler
|
r11856 | |||
Steve Borho
|
r12810 | $ hg backout -d '3 0' --merge tip --tool=true | ||
Martin Geisler
|
r11856 | removing a | ||
changeset 3:7f6d0f120113 backs out changeset 2:de31bdc76c0d | ||||
Mads Kiilerich
|
r15515 | $ test -f a | ||
[1] | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 3:7f6d0f120113 tip | ||||
Backed out changeset de31bdc76c0d | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 4 draft | ||
Martin Geisler
|
r11856 | |||
FUJIWARA Katsunori
|
r25878 | Test that 'hg rollback' restores dirstate just before opening | ||
transaction: in-memory dirstate changes should be written into | ||||
'.hg/journal.dirstate' as expected. | ||||
$ echo 'removed soon' > b | ||||
$ hg commit -A -d '4 0' -m 'prepare for subsequent removing' | ||||
adding b | ||||
$ echo 'newly added' > c | ||||
$ hg add c | ||||
$ hg remove b | ||||
$ hg commit -d '5 0' -m 'prepare for subsequent backout' | ||||
$ touch -t 200001010000 c | ||||
$ hg status -A | ||||
C c | ||||
Martin von Zweigbergk
|
r39796 | $ hg debugstate --no-dates | ||
FUJIWARA Katsunori
|
r25878 | n 644 12 set c | ||
$ hg backout -d '6 0' -m 'to be rollback-ed soon' -r . | ||||
Sushil khanchi
|
r39442 | removing c | ||
FUJIWARA Katsunori
|
r25878 | adding b | ||
changeset 6:4bfec048029d backs out changeset 5:fac0b729a654 | ||||
$ hg rollback -q | ||||
$ hg status -A | ||||
A b | ||||
R c | ||||
Martin von Zweigbergk
|
r39796 | $ hg debugstate --no-dates | ||
FUJIWARA Katsunori
|
r25878 | a 0 -1 unset b | ||
r 0 0 set c | ||||
Matt Mackall
|
r12328 | across branch | ||
Martin Geisler
|
r11856 | |||
$ cd .. | ||||
$ hg init branch | ||||
$ cd branch | ||||
$ echo a > a | ||||
$ hg ci -Am0 | ||||
adding a | ||||
$ echo b > b | ||||
$ hg ci -Am1 | ||||
adding b | ||||
$ hg co -C 0 | ||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 0:f7b1eb17ad24 | ||||
0 | ||||
branch: default | ||||
commit: (clean) | ||||
update: 1 new changesets (update) | ||||
Gilles Moris
|
r25382 | phases: 2 draft | ||
Martin Geisler
|
r11856 | |||
should fail | ||||
$ hg backout 1 | ||||
Mads Kiilerich
|
r20791 | abort: cannot backout change that is not an ancestor | ||
Matt Mackall
|
r12316 | [255] | ||
Martin Geisler
|
r11856 | $ echo c > c | ||
$ hg ci -Am2 | ||||
adding c | ||||
created new head | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 2:db815d6d32e6 tip | ||||
2 | ||||
branch: default | ||||
commit: (clean) | ||||
update: 1 new changesets, 2 branch heads (merge) | ||||
Gilles Moris
|
r25382 | phases: 3 draft | ||
Martin Geisler
|
r11856 | |||
should fail | ||||
$ hg backout 1 | ||||
Mads Kiilerich
|
r20791 | abort: cannot backout change that is not an ancestor | ||
Matt Mackall
|
r12316 | [255] | ||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 2:db815d6d32e6 tip | ||||
2 | ||||
branch: default | ||||
commit: (clean) | ||||
update: 1 new changesets, 2 branch heads (merge) | ||||
Gilles Moris
|
r25382 | phases: 3 draft | ||
Martin Geisler
|
r11856 | |||
Matt Mackall
|
r12328 | backout with merge | ||
Martin Geisler
|
r11856 | |||
$ cd .. | ||||
$ hg init merge | ||||
$ cd merge | ||||
$ echo line 1 > a | ||||
$ echo line 2 >> a | ||||
$ hg commit -d '0 0' -A -m a | ||||
adding a | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 0:59395513a13a tip | ||||
a | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 1 draft | ||
Martin Geisler
|
r11856 | |||
remove line 1 | ||||
$ echo line 2 > a | ||||
$ hg commit -d '1 0' -m b | ||||
$ echo line 3 >> a | ||||
$ hg commit -d '2 0' -m c | ||||
Steve Borho
|
r12810 | $ hg backout --merge -d '3 0' 1 --tool=true | ||
Martin Geisler
|
r11856 | reverting a | ||
created new head | ||||
changeset 3:26b8ccb9ad91 backs out changeset 1:5a50a024c182 | ||||
merging with changeset 3:26b8ccb9ad91 | ||||
merging a | ||||
0 files updated, 1 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ hg commit -d '4 0' -m d | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 4:c7df5e0b9c09 tip | ||||
d | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 5 draft | ||
Martin Geisler
|
r11856 | |||
check line 1 is back | ||||
$ cat a | ||||
line 1 | ||||
line 2 | ||||
line 3 | ||||
FUJIWARA Katsunori
|
r26751 | Test visibility of in-memory dirstate changes outside transaction to | ||
external hook process | ||||
$ cat > $TESTTMP/checkvisibility.sh <<EOF | ||||
> echo "==== \$1:" | ||||
> hg parents --template "{rev}:{node|short}\n" | ||||
> echo "====" | ||||
> EOF | ||||
"hg backout --merge REV1" at REV2 below implies steps below: | ||||
(1) update to REV1 (REV2 => REV1) | ||||
(2) revert by REV1^1 | ||||
Mads Kiilerich
|
r30332 | (3) commit backing out revision (REV3) | ||
FUJIWARA Katsunori
|
r26751 | (4) update to REV2 (REV3 => REV2) | ||
(5) merge with REV3 (REV2 => REV2, REV3) | ||||
== test visibility to external preupdate hook | ||||
$ hg update -q -C 2 | ||||
$ hg --config extensions.strip= strip 3 | ||||
saved backup bundle to * (glob) | ||||
$ cat >> .hg/hgrc <<EOF | ||||
> [hooks] | ||||
> preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate | ||||
> EOF | ||||
Mads Kiilerich
|
r30332 | ("-m" is needed to avoid writing dirstate changes out at other than | ||
FUJIWARA Katsunori
|
r26751 | invocation of the hook to be examined) | ||
$ hg backout --merge -d '3 0' 1 --tool=true -m 'fixed comment' | ||||
==== preupdate: | ||||
2:6ea3f2a197a2 | ||||
==== | ||||
reverting a | ||||
created new head | ||||
changeset 3:d92a3f57f067 backs out changeset 1:5a50a024c182 | ||||
==== preupdate: | ||||
3:d92a3f57f067 | ||||
==== | ||||
merging with changeset 3:d92a3f57f067 | ||||
==== preupdate: | ||||
2:6ea3f2a197a2 | ||||
==== | ||||
merging a | ||||
0 files updated, 1 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ cat >> .hg/hgrc <<EOF | ||||
> [hooks] | ||||
> preupdate.visibility = | ||||
> EOF | ||||
FUJIWARA Katsunori
|
r26752 | == test visibility to external update hook | ||
$ hg update -q -C 2 | ||||
$ hg --config extensions.strip= strip 3 | ||||
saved backup bundle to * (glob) | ||||
$ cat >> .hg/hgrc <<EOF | ||||
> [hooks] | ||||
> update.visibility = sh $TESTTMP/checkvisibility.sh update | ||||
> EOF | ||||
$ hg backout --merge -d '3 0' 1 --tool=true -m 'fixed comment' | ||||
==== update: | ||||
1:5a50a024c182 | ||||
==== | ||||
reverting a | ||||
created new head | ||||
changeset 3:d92a3f57f067 backs out changeset 1:5a50a024c182 | ||||
==== update: | ||||
2:6ea3f2a197a2 | ||||
==== | ||||
merging with changeset 3:d92a3f57f067 | ||||
merging a | ||||
==== update: | ||||
2:6ea3f2a197a2 | ||||
3:d92a3f57f067 | ||||
==== | ||||
0 files updated, 1 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ cat >> .hg/hgrc <<EOF | ||||
> [hooks] | ||||
> update.visibility = | ||||
> EOF | ||||
Mads Kiilerich
|
r16912 | $ cd .. | ||
Matt Mackall
|
r12328 | backout should not back out subsequent changesets | ||
Martin Geisler
|
r11856 | |||
$ hg init onecs | ||||
$ cd onecs | ||||
$ echo 1 > a | ||||
$ hg commit -d '0 0' -A -m a | ||||
adding a | ||||
$ echo 2 >> a | ||||
$ hg commit -d '1 0' -m b | ||||
$ echo 1 > b | ||||
$ hg commit -d '2 0' -A -m c | ||||
adding b | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 2:882396649954 tip | ||||
c | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 3 draft | ||
Gilles Moris
|
r12727 | |||
without --merge | ||||
Ruslan Sayfutdinov
|
r27890 | $ hg backout --no-commit -d '3 0' 1 --tool=true | ||
Gilles Moris
|
r12727 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||
Pierre-Yves David
|
r20276 | changeset 22bca4c721e5 backed out, don't forget to commit. | ||
Gilles Moris
|
r12727 | $ hg locate b | ||
b | ||||
$ hg update -C tip | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
$ hg locate b | ||||
b | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 2:882396649954 tip | ||||
c | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 3 draft | ||
Gilles Moris
|
r12727 | |||
with --merge | ||||
Steve Borho
|
r12810 | $ hg backout --merge -d '3 0' 1 --tool=true | ||
Gilles Moris
|
r12727 | reverting a | ||
Martin Geisler
|
r11856 | created new head | ||
changeset 3:3202beb76721 backs out changeset 1:22bca4c721e5 | ||||
Gilles Moris
|
r12727 | merging with changeset 3:3202beb76721 | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
Martin Geisler
|
r11856 | $ hg locate b | ||
b | ||||
$ hg update -C tip | ||||
1 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ hg locate b | ||||
Matt Mackall
|
r12316 | [1] | ||
Martin Geisler
|
r11856 | |||
$ cd .. | ||||
$ hg init m | ||||
$ cd m | ||||
$ echo a > a | ||||
$ hg commit -d '0 0' -A -m a | ||||
adding a | ||||
$ echo b > b | ||||
$ hg commit -d '1 0' -A -m b | ||||
adding b | ||||
$ echo c > c | ||||
$ hg commit -d '2 0' -A -m b | ||||
adding c | ||||
$ hg update 1 | ||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ echo d > d | ||||
$ hg commit -d '3 0' -A -m c | ||||
adding d | ||||
created new head | ||||
$ hg merge 2 | ||||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ hg commit -d '4 0' -A -m d | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 4:b2f3bb92043e tip | ||||
d | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 5 draft | ||
Martin Geisler
|
r11856 | |||
Matt Mackall
|
r12328 | backout of merge should fail | ||
Martin Geisler
|
r11856 | |||
$ hg backout 4 | ||||
Matt Mackall
|
r15211 | abort: cannot backout a merge changeset | ||
Matt Mackall
|
r12316 | [255] | ||
Martin Geisler
|
r11856 | |||
Matt Mackall
|
r12328 | backout of merge with bad parent should fail | ||
Martin Geisler
|
r11856 | |||
$ hg backout --parent 0 4 | ||||
abort: cb9a9f314b8b is not a parent of b2f3bb92043e | ||||
Matt Mackall
|
r12316 | [255] | ||
Martin Geisler
|
r11856 | |||
Matt Mackall
|
r12328 | backout of non-merge with parent should fail | ||
Martin Geisler
|
r11856 | |||
$ hg backout --parent 0 3 | ||||
abort: cannot use --parent on non-merge changeset | ||||
Matt Mackall
|
r12316 | [255] | ||
Martin Geisler
|
r11856 | |||
Matt Mackall
|
r12328 | backout with valid parent should be ok | ||
Martin Geisler
|
r11856 | |||
Steve Borho
|
r12810 | $ hg backout -d '5 0' --parent 2 4 --tool=true | ||
Martin Geisler
|
r11856 | removing d | ||
changeset 5:10e5328c8435 backs out changeset 4:b2f3bb92043e | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 5:10e5328c8435 tip | ||||
Backed out changeset b2f3bb92043e | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 6 draft | ||
Martin Geisler
|
r11856 | |||
$ hg rollback | ||||
Gilles Moris
|
r13446 | repository tip rolled back to revision 4 (undo commit) | ||
working directory now based on revision 4 | ||||
Martin Geisler
|
r11856 | $ hg update -C | ||
1 files updated, 0 files merged, 0 files removed, 0 files unresolved | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 4:b2f3bb92043e tip | ||||
d | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 5 draft | ||
Martin Geisler
|
r11856 | |||
Steve Borho
|
r12810 | $ hg backout -d '6 0' --parent 3 4 --tool=true | ||
Martin Geisler
|
r11856 | removing c | ||
changeset 5:033590168430 backs out changeset 4:b2f3bb92043e | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 5:033590168430 tip | ||||
Backed out changeset b2f3bb92043e | ||||
branch: default | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 6 draft | ||
Martin Geisler
|
r11856 | |||
$ cd .. | ||||
Matt Mackall
|
r12328 | named branches | ||
Martin Geisler
|
r11856 | |||
$ hg init named_branches | ||||
$ cd named_branches | ||||
$ echo default > default | ||||
$ hg ci -d '0 0' -Am default | ||||
adding default | ||||
$ hg branch branch1 | ||||
marked working directory as branch branch1 | ||||
Matt Mackall
|
r15615 | (branches are permanent and global, did you want a bookmark?) | ||
Martin Geisler
|
r11856 | $ echo branch1 > file1 | ||
$ hg ci -d '1 0' -Am file1 | ||||
adding file1 | ||||
$ hg branch branch2 | ||||
marked working directory as branch branch2 | ||||
$ echo branch2 > file2 | ||||
$ hg ci -d '2 0' -Am file2 | ||||
adding file2 | ||||
Gilles Moris
|
r12727 | |||
without --merge | ||||
Ruslan Sayfutdinov
|
r27890 | $ hg backout --no-commit -r 1 --tool=true | ||
Pierre-Yves David
|
r20275 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||
Pierre-Yves David
|
r20276 | changeset bf1602f437f3 backed out, don't forget to commit. | ||
Gilles Moris
|
r12727 | $ hg branch | ||
branch2 | ||||
$ hg status -A | ||||
R file1 | ||||
C default | ||||
C file2 | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 2:45bbcd363bf0 tip | ||||
file2 | ||||
branch: branch2 | ||||
commit: 1 removed | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 3 draft | ||
Gilles Moris
|
r12727 | |||
with --merge | ||||
FUJIWARA Katsunori
|
r21712 | (this also tests that editor is invoked if '--edit' is specified | ||
explicitly regardless of '--message') | ||||
Gilles Moris
|
r12727 | $ hg update -qC | ||
FUJIWARA Katsunori
|
r21712 | $ HGEDITOR=cat hg backout --merge -d '3 0' -r 1 -m 'backout on branch1' --tool=true --edit | ||
Martin Geisler
|
r11856 | removing file1 | ||
FUJIWARA Katsunori
|
r21712 | backout on branch1 | ||
HG: Enter commit message. Lines beginning with 'HG:' are removed. | ||||
HG: Leave message empty to abort commit. | ||||
HG: -- | ||||
HG: user: test | ||||
HG: branch 'branch2' | ||||
HG: removed file1 | ||||
Martin Geisler
|
r11856 | created new head | ||
changeset 3:d4e8f6db59fb backs out changeset 1:bf1602f437f3 | ||||
Gilles Moris
|
r12727 | merging with changeset 3:d4e8f6db59fb | ||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 2:45bbcd363bf0 | ||||
file2 | ||||
parent: 3:d4e8f6db59fb tip | ||||
backout on branch1 | ||||
branch: branch2 | ||||
commit: 1 removed (merge) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 4 draft | ||
Gilles Moris
|
r12727 | $ hg update -q -C 2 | ||
Martin Geisler
|
r11856 | |||
on branch2 with branch1 not merged, so file1 should still exist: | ||||
$ hg id | ||||
45bbcd363bf0 (branch2) | ||||
$ hg st -A | ||||
C default | ||||
C file1 | ||||
C file2 | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 2:45bbcd363bf0 | ||||
file2 | ||||
branch: branch2 | ||||
commit: (clean) | ||||
update: 1 new changesets, 2 branch heads (merge) | ||||
Gilles Moris
|
r25382 | phases: 4 draft | ||
Martin Geisler
|
r11856 | |||
on branch2 with branch1 merged, so file1 should be gone: | ||||
$ hg merge | ||||
0 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
(branch merge, don't forget to commit) | ||||
$ hg ci -d '4 0' -m 'merge backout of branch1' | ||||
$ hg id | ||||
Valentin Gatien-Baron
|
r42840 | d97a8500a969 (branch2) tip | ||
Martin Geisler
|
r11856 | $ hg st -A | ||
C default | ||||
C file2 | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
Valentin Gatien-Baron
|
r42840 | parent: 4:d97a8500a969 tip | ||
Pierre-Yves David
|
r20270 | merge backout of branch1 | ||
branch: branch2 | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 5 draft | ||
Martin Geisler
|
r11856 | |||
on branch1, so no file1 and file2: | ||||
$ hg co -C branch1 | ||||
1 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ hg id | ||||
bf1602f437f3 (branch1) | ||||
$ hg st -A | ||||
C default | ||||
C file1 | ||||
Pierre-Yves David
|
r20270 | $ hg summary | ||
parent: 1:bf1602f437f3 | ||||
file1 | ||||
branch: branch1 | ||||
commit: (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 5 draft | ||
Mads Kiilerich
|
r16912 | |||
$ cd .. | ||||
Pierre-Yves David
|
r20594 | |||
Yuya Nishihara
|
r20872 | backout of empty changeset (issue4190) | ||
$ hg init emptycommit | ||||
$ cd emptycommit | ||||
$ touch file1 | ||||
$ hg ci -Aqm file1 | ||||
$ hg branch -q branch1 | ||||
$ hg ci -qm branch1 | ||||
$ hg backout -v 1 | ||||
resolving manifests | ||||
nothing changed | ||||
[1] | ||||
$ cd .. | ||||
Pierre-Yves David
|
r20594 | |||
Test usage of `hg resolve` in case of conflict | ||||
(issue4163) | ||||
$ hg init issue4163 | ||||
$ cd issue4163 | ||||
$ touch foo | ||||
$ hg add foo | ||||
$ cat > foo << EOF | ||||
> one | ||||
> two | ||||
> three | ||||
> four | ||||
> five | ||||
> six | ||||
> seven | ||||
> height | ||||
> nine | ||||
> ten | ||||
> EOF | ||||
$ hg ci -m 'initial' | ||||
$ cat > foo << EOF | ||||
> one | ||||
> two | ||||
> THREE | ||||
> four | ||||
> five | ||||
> six | ||||
> seven | ||||
> height | ||||
> nine | ||||
> ten | ||||
> EOF | ||||
$ hg ci -m 'capital three' | ||||
$ cat > foo << EOF | ||||
> one | ||||
> two | ||||
> THREE | ||||
> four | ||||
> five | ||||
> six | ||||
> seven | ||||
> height | ||||
> nine | ||||
> TEN | ||||
> EOF | ||||
$ hg ci -m 'capital ten' | ||||
$ hg backout -r 'desc("capital three")' --tool internal:fail | ||||
0 files updated, 0 files merged, 0 files removed, 1 files unresolved | ||||
use 'hg resolve' to retry unresolved file merges | ||||
[1] | ||||
$ hg status | ||||
Martin von Zweigbergk
|
r44880 | $ hg debugmergestate -v | ||
v1 and v2 states match: using v2 | ||||
Siddharth Agarwal
|
r26501 | local: b71750c4b0fdf719734971e3ef90dbeab5919a2d | ||
other: a30dd8addae3ce71b8667868478542bc417439e6 | ||||
Martin von Zweigbergk
|
r44880 | file: foo (state "u") | ||
local path: foo (hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33, flags "") | ||||
Siddharth Agarwal
|
r26501 | ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708) | ||
other path: foo (node f50039b486d6fa1a90ae51778388cad161f425ee) | ||||
Martin von Zweigbergk
|
r44880 | extra: ancestorlinknode = 91360952243723bd5b1138d5f26bd8c8564cb553 | ||
Siddharth Agarwal
|
r26501 | $ mv .hg/merge/state2 .hg/merge/state2-moved | ||
Martin von Zweigbergk
|
r44880 | $ hg debugmergestate -v | ||
no version 2 merge state | ||||
Siddharth Agarwal
|
r26501 | local: b71750c4b0fdf719734971e3ef90dbeab5919a2d | ||
Martin von Zweigbergk
|
r44880 | other: b71750c4b0fdf719734971e3ef90dbeab5919a2d | ||
file: foo (state "u") | ||||
local path: foo (hash 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33, flags "") | ||||
Siddharth Agarwal
|
r26501 | ancestor path: foo (node f89532f44c247a0e993d63e3a734dd781ab04708) | ||
Martin von Zweigbergk
|
r44880 | other path: (node foo) | ||
Siddharth Agarwal
|
r26501 | $ mv .hg/merge/state2-moved .hg/merge/state2 | ||
Pierre-Yves David
|
r20594 | $ hg resolve -l # still unresolved | ||
U foo | ||||
$ hg summary | ||||
parent: 2:b71750c4b0fd tip | ||||
capital ten | ||||
branch: default | ||||
commit: 1 unresolved (clean) | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 3 draft | ||
Martin von Zweigbergk
|
r44818 | $ hg log -G | ||
@ changeset: 2:b71750c4b0fd | ||||
| tag: tip | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: capital ten | ||||
| | ||||
o changeset: 1:913609522437 | ||||
| user: test | ||||
| date: Thu Jan 01 00:00:00 1970 +0000 | ||||
| summary: capital three | ||||
| | ||||
Martin von Zweigbergk
|
r44819 | % changeset: 0:a30dd8addae3 | ||
Martin von Zweigbergk
|
r44818 | user: test | ||
date: Thu Jan 01 00:00:00 1970 +0000 | ||||
summary: initial | ||||
Pierre-Yves David
|
r20594 | $ hg resolve --all --debug | ||
Siddharth Agarwal
|
r27161 | picked tool ':merge' for foo (binary False symlink False changedelete False) | ||
Pierre-Yves David
|
r20594 | merging foo | ||
my foo@b71750c4b0fd+ other foo@a30dd8addae3 ancestor foo@913609522437 | ||||
premerge successful | ||||
Pierre-Yves David
|
r21947 | (no more unresolved files) | ||
timeless
|
r27624 | continue: hg commit | ||
Pierre-Yves David
|
r20594 | $ hg status | ||
M foo | ||||
? foo.orig | ||||
$ hg resolve -l | ||||
R foo | ||||
$ hg summary | ||||
parent: 2:b71750c4b0fd tip | ||||
capital ten | ||||
branch: default | ||||
commit: 1 modified, 1 unknown | ||||
update: (current) | ||||
Gilles Moris
|
r25382 | phases: 3 draft | ||
Pierre-Yves David
|
r20594 | $ cat foo | ||
one | ||||
two | ||||
three | ||||
four | ||||
five | ||||
six | ||||
seven | ||||
height | ||||
nine | ||||
TEN | ||||
Ruslan Sayfutdinov
|
r27912 | --no-commit shouldn't commit | ||
Pierre-Yves David
|
r20594 | |||
Ruslan Sayfutdinov
|
r27912 | $ hg init a | ||
$ cd a | ||||
$ for i in 1 2 3; do | ||||
> touch $i | ||||
> hg ci -Am $i | ||||
> done | ||||
adding 1 | ||||
adding 2 | ||||
adding 3 | ||||
$ hg backout --no-commit . | ||||
removing 3 | ||||
changeset cccc23d9d68f backed out, don't forget to commit. | ||||
Yuya Nishihara
|
r27954 | $ hg revert -aq | ||
--no-commit can't be used with --merge | ||||
$ hg backout --merge --no-commit 2 | ||||
Martin von Zweigbergk
|
r46331 | abort: cannot specify both --no-commit and --merge | ||
Yuya Nishihara
|
r27954 | [255] | ||
Dan Villiom Podlaski Christiansen
|
r46382 | |||
Ensure that backout out the same changeset twice performs correctly: | ||||
$ hg backout 2 | ||||
removing 3 | ||||
changeset 3:8f188de730d9 backs out changeset 2:cccc23d9d68f | ||||
$ echo 4 > 4 | ||||
$ hg ci -A -m 4 | ||||
adding 4 | ||||
$ hg up 2 | ||||
1 files updated, 0 files merged, 1 files removed, 0 files unresolved | ||||
$ hg backout 2 | ||||
removing 3 | ||||
Dan Villiom Podlaski Christiansen
|
r46392 | warning: commit already existed in the repository! | ||
Dan Villiom Podlaski Christiansen
|
r46382 | changeset 3:8f188de730d9 backs out changeset 2:cccc23d9d68f | ||