author | Patrick Mezard <pmezard@gmail.com> |
Mon, 13 Aug 2007 19:42:52 +0200 | |
changeset 5163 | b51d07ed1b18 |
parent 4726 | f6e961c0155b |
child 5568 | de620356064f |
permissions | -rwxr-xr-x |
2158 | 1 |
#!/bin/sh |
2 |
||
4365
46280c004f22
change tests to use simplemerge by default
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2614
diff
changeset
|
3 |
HGMERGE=true; export HGMERGE |
46280c004f22
change tests to use simplemerge by default
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
2614
diff
changeset
|
4 |
|
2158 | 5 |
hg init basic |
6 |
cd basic |
|
4726
f6e961c0155b
Fix and test 'hg backout' without or with too many revisions.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
4365
diff
changeset
|
7 |
|
f6e961c0155b
Fix and test 'hg backout' without or with too many revisions.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
4365
diff
changeset
|
8 |
echo '# should complain' |
f6e961c0155b
Fix and test 'hg backout' without or with too many revisions.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
4365
diff
changeset
|
9 |
hg backout |
f6e961c0155b
Fix and test 'hg backout' without or with too many revisions.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
4365
diff
changeset
|
10 |
hg backout -r 0 0 |
f6e961c0155b
Fix and test 'hg backout' without or with too many revisions.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
4365
diff
changeset
|
11 |
|
f6e961c0155b
Fix and test 'hg backout' without or with too many revisions.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
4365
diff
changeset
|
12 |
echo '# basic operation' |
2158 | 13 |
echo a > a |
14 |
hg commit -d '0 0' -A -m a |
|
15 |
echo b >> a |
|
16 |
hg commit -d '1 0' -m b |
|
17 |
||
18 |
hg backout -d '2 0' tip |
|
19 |
cat a |
|
20 |
||
21 |
echo '# file that was removed is recreated' |
|
22 |
cd .. |
|
23 |
hg init remove |
|
24 |
cd remove |
|
25 |
||
26 |
echo content > a |
|
27 |
hg commit -d '0 0' -A -m a |
|
28 |
||
29 |
hg rm a |
|
30 |
hg commit -d '1 0' -m b |
|
31 |
||
32 |
hg backout -d '2 0' --merge tip |
|
33 |
cat a |
|
34 |
||
35 |
echo '# backout of backout is as if nothing happened' |
|
36 |
||
37 |
hg backout -d '3 0' --merge tip |
|
2186
1092533fd11c
tests: fix compatibility on Solaris
TK Soh <teekaysoh@yahoo.com>
parents:
2158
diff
changeset
|
38 |
cat a 2>/dev/null || echo cat: a: No such file or directory |
2158 | 39 |
|
40 |
echo '# backout with merge' |
|
41 |
cd .. |
|
42 |
hg init merge |
|
43 |
cd merge |
|
44 |
||
45 |
echo line 1 > a |
|
46 |
hg commit -d '0 0' -A -m a |
|
47 |
||
48 |
echo line 2 >> a |
|
49 |
hg commit -d '1 0' -m b |
|
50 |
||
51 |
echo line 3 >> a |
|
52 |
hg commit -d '2 0' -m c |
|
53 |
||
54 |
hg backout --merge -d '3 0' 1 |
|
55 |
hg commit -d '4 0' -m d |
|
56 |
cat a |
|
57 |
||
2492 | 58 |
echo '# backout should not back out subsequent changesets' |
59 |
hg init onecs |
|
60 |
cd onecs |
|
61 |
echo 1 > a |
|
62 |
hg commit -d '0 0' -A -m a |
|
63 |
echo 2 >> a |
|
64 |
hg commit -d '1 0' -m b |
|
65 |
echo 1 > b |
|
66 |
hg commit -d '2 0' -A -m c |
|
67 |
hg backout -d '3 0' 1 |
|
68 |
hg locate b |
|
69 |
||
2614
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
70 |
cd .. |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
71 |
hg init m |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
72 |
cd m |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
73 |
echo a > a |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
74 |
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
|
75 |
echo b > b |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
76 |
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
|
77 |
echo c > c |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
78 |
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
|
79 |
hg update 1 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
80 |
echo d > d |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
81 |
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
|
82 |
hg merge 2 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
83 |
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
|
84 |
|
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
85 |
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
|
86 |
|
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
87 |
hg backout 4 |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
88 |
|
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
89 |
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
|
90 |
|
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
91 |
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
|
92 |
|
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
93 |
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
|
94 |
|
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
95 |
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
|
96 |
|
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
97 |
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
|
98 |
|
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
99 |
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
|
100 |
|
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
101 |
hg rollback |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
102 |
hg update -C |
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
103 |
|
8ba1c31f6864
backout: allow backout of merge changeset with --parent option.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents:
2492
diff
changeset
|
104 |
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
|
105 |
|
2158 | 106 |
exit 0 |