Mercurial > hg
annotate tests/test-backout @ 2614:8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
--parent allows to choose which parent of merge to revert to.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Fri, 14 Jul 2006 23:19:15 -0700 |
parents | 2f4addf56715 |
children | 46280c004f22 |
rev | line source |
---|---|
2158 | 1 #!/bin/sh |
2 | |
3 echo '# basic operation' | |
4 hg init basic | |
5 cd basic | |
6 echo a > a | |
7 hg commit -d '0 0' -A -m a | |
8 echo b >> a | |
9 hg commit -d '1 0' -m b | |
10 | |
11 hg backout -d '2 0' tip | |
12 cat a | |
13 | |
14 echo '# file that was removed is recreated' | |
15 cd .. | |
16 hg init remove | |
17 cd remove | |
18 | |
19 echo content > a | |
20 hg commit -d '0 0' -A -m a | |
21 | |
22 hg rm a | |
23 hg commit -d '1 0' -m b | |
24 | |
25 hg backout -d '2 0' --merge tip | |
26 cat a | |
27 | |
28 echo '# backout of backout is as if nothing happened' | |
29 | |
30 hg backout -d '3 0' --merge tip | |
2186
1092533fd11c
tests: fix compatibility on Solaris
TK Soh <teekaysoh@yahoo.com>
parents:
2158
diff
changeset
|
31 cat a 2>/dev/null || echo cat: a: No such file or directory |
2158 | 32 |
33 echo '# backout with merge' | |
34 cd .. | |
35 hg init merge | |
36 cd merge | |
37 | |
38 echo line 1 > a | |
39 hg commit -d '0 0' -A -m a | |
40 | |
41 echo line 2 >> a | |
42 hg commit -d '1 0' -m b | |
43 | |
44 echo line 3 >> a | |
45 hg commit -d '2 0' -m c | |
46 | |
47 hg backout --merge -d '3 0' 1 | |
48 hg commit -d '4 0' -m d | |
49 cat a | |
50 | |
2492 | 51 echo '# backout should not back out subsequent changesets' |
52 hg init onecs | |
53 cd onecs | |
54 echo 1 > a | |
55 hg commit -d '0 0' -A -m a | |
56 echo 2 >> a | |
57 hg commit -d '1 0' -m b | |
58 echo 1 > b | |
59 hg commit -d '2 0' -A -m c | |
60 hg backout -d '3 0' 1 | |
61 hg locate b | |
62 | |
2614
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
63 cd .. |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
64 hg init m |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
65 cd m |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
66 echo a > a |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
67 hg commit -d '0 0' -A -m a |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
68 echo b > b |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
69 hg commit -d '1 0' -A -m b |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
70 echo c > c |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
71 hg commit -d '2 0' -A -m b |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
72 hg update 1 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
73 echo d > d |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
74 hg commit -d '3 0' -A -m c |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
75 hg merge 2 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
76 hg commit -d '4 0' -A -m d |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
77 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
78 echo '# backout of merge should fail' |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
79 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
80 hg backout 4 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
81 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
82 echo '# backout of merge with bad parent should fail' |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
83 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
84 hg backout --parent 0 4 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
85 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
86 echo '# backout of non-merge with parent should fail' |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
87 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
88 hg backout --parent 0 3 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
89 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
90 echo '# backout with valid parent should be ok' |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
91 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
92 hg backout -d '5 0' --parent 2 4 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
93 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
94 hg rollback |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
95 hg update -C |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
96 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
97 hg backout -d '6 0' --parent 3 4 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
98 |
2158 | 99 exit 0 |