annotate tests/test-revert.t @ 16496:abbabbbe4ec2 stable

tests: use 'do sleep 0' instead of 'do true', also on first line of command f64b25f147d7 established that '... do true ...' shouldn't be used, but that was only enforced on continued lines.
author Mads Kiilerich <mads@kiilerich.com>
date Mon, 23 Apr 2012 01:56:48 +0200
parents 117f9190c1ba
children 8c1cf3e3fe42
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
15442
db0340f4b507 tests: use 'hghave execbit' for tests that manipulate x bit in file system
Mads Kiilerich <mads@kiilerich.com>
parents: 14767
diff changeset
1 $ "$TESTDIR/hghave" execbit || exit 80
db0340f4b507 tests: use 'hghave execbit' for tests that manipulate x bit in file system
Mads Kiilerich <mads@kiilerich.com>
parents: 14767
diff changeset
2
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
3 $ hg init repo
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
4 $ cd repo
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
5 $ echo 123 > a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
6 $ echo 123 > c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
7 $ echo 123 > e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
8 $ hg add a c e
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
9 $ hg commit -m "first" a c e
14745
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
10
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
11 nothing changed
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
12
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
13 $ hg revert
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
14 abort: no files or directories specified
14755
6ba51c81ff75 revert: improve hints on abort when reverting to parent without --all
Adrian Buehlmann <adrian@cadifra.com>
parents: 14745
diff changeset
15 (use --all to revert all files)
14745
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
16 [255]
14767
aab323df2c44 test-revert: add revert --all case when nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14755
diff changeset
17 $ hg revert --all
14745
cae09a39b2d2 test-revert: add case for nothing changed
Adrian Buehlmann <adrian@cadifra.com>
parents: 14726
diff changeset
18
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
19 $ echo 123 > b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
20
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
21 should show b unknown
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
22
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
23 $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
24 ? b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
25 $ echo 12 > c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
26
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
27 should show b unknown and c modified
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
28
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
29 $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
30 M c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
31 ? b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
32 $ hg add b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
33
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
34 should show b added and c modified
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
35
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
36 $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
37 M c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
38 A b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
39 $ hg rm a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
40
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
41 should show a removed, b added and c modified
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
42
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
43 $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
44 M c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
45 A b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
46 R a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
47 $ hg revert a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
48
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
49 should show b added, copy saved, and c modified
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
50
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
51 $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
52 M c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
53 A b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
54 $ hg revert b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
55
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
56 should show b unknown, and c modified
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
57
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
58 $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
59 M c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
60 ? b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
61 $ hg revert --no-backup c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
62
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
63 should show unknown: b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
64
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
65 $ hg status
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
66 ? b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
67 $ hg add b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
68
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
69 should show b added
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
70
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
71 $ hg status b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
72 A b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
73 $ rm b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
74
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
75 should show b deleted
1447
508a3f559553 revert added and removed files to their normal state before reverting
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
76
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
77 $ hg status b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
78 ! b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
79 $ hg revert -v b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
80 forgetting b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
81
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
82 should not find b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
83
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
84 $ hg status b
15521
117f9190c1ba tests: hide 'No such file or directory' messages
Mads Kiilerich <mads@kiilerich.com>
parents: 15447
diff changeset
85 b: * (glob)
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
86
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
87 should show a c e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
88
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
89 $ ls
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
90 a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
91 c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
92 e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
93
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
94 should verbosely save backup to e.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
95
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
96 $ echo z > e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
97 $ hg revert --all -v
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
98 saving current version of e as e.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
99 reverting e
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
100
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
101 should say no changes needed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
102
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
103 $ hg revert a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
104 no changes needed to a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
105
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
106 should say file not managed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
107
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
108 $ echo q > q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
109 $ hg revert q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
110 file not managed: q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
111 $ rm q
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
112
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
113 should say file not found
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
114
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
115 $ hg revert notfound
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
116 notfound: no such file in rev 334a9e57682c
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
117 $ touch d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
118 $ hg add d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
119 $ hg rm a
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
120 $ hg commit -m "second"
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
121 $ echo z > z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
122 $ hg add z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
123 $ hg st
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
124 A z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
125 ? e.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
126
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
127 should add a, remove d, forget z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
128
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
129 $ hg revert --all -r0
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
130 adding a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
131 removing d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
132 forgetting z
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
133
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
134 should forget a, undelete d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
135
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
136 $ hg revert --all -rtip
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
137 forgetting a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
138 undeleting d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
139 $ rm a *.orig
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
140
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
141 should silently add a
1447
508a3f559553 revert added and removed files to their normal state before reverting
Benoit Boissinot <benoit.boissinot@ens-lyon.org>
parents:
diff changeset
142
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
143 $ hg revert -r0 a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
144 $ hg st a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
145 A a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
146 $ hg rm d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
147 $ hg st d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
148 R d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
149
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
150 should silently keep d removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
151
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
152 $ hg revert -r0 d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
153 $ hg st d
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
154 R d
2157
1e82f2337498 make test-revert check executable bit.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2043
diff changeset
155
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
156 $ hg update -C
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
157 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
158 $ chmod +x c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
159 $ hg revert --all
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
160 reverting c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
161
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
162 should print non-executable
2157
1e82f2337498 make test-revert check executable bit.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2043
diff changeset
163
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
164 $ test -x c || echo non-executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
165 non-executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
166
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
167 $ chmod +x c
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
168 $ hg commit -m exe
2157
1e82f2337498 make test-revert check executable bit.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2043
diff changeset
169
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
170 $ chmod -x c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
171 $ hg revert --all
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
172 reverting c
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
173
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
174 should print executable
6031
7383384793fb revert: don't assume ignored files will be returned in the unknown list
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5230
diff changeset
175
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
176 $ test -x c && echo executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
177 executable
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
178
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
179 $ cd ..
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
180
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
181
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12316
diff changeset
182 Issue241: update and revert produces inconsistent repositories
2982
890e285c52a1 revert: require --all to revert all files.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2272
diff changeset
183
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
184 $ hg init a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
185 $ cd a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
186 $ echo a >> a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
187 $ hg commit -A -d '1 0' -m a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
188 adding a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
189 $ echo a >> a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
190 $ hg commit -d '2 0' -m a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
191 $ hg update 0
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
192 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
193 $ mkdir b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
194 $ echo b > b/b
2272
e9a0ed9ed4d9 revert: fix corner case found by faheem mitha.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2157
diff changeset
195
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
196 should fail - no arguments
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
197
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
198 $ hg revert -rtip
14542
afe0d4c24866 revert: drop requirement to use -r to revert with two parents
Matt Mackall <mpm@selenic.com>
parents: 12399
diff changeset
199 abort: no files or directories specified
14726
e0039716f3ea revert: mention update in hint of abort when reverting to non-parent
Adrian Buehlmann <adrian@cadifra.com>
parents: 14713
diff changeset
200 (use --all to revert all files, or 'hg update 1' to update)
12316
4134686b83e1 tests: add exit codes to unified tests
Matt Mackall <mpm@selenic.com>
parents: 12156
diff changeset
201 [255]
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
202
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
203 should succeed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
204
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
205 $ hg revert --all -rtip
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
206 reverting a
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
207
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
208
12399
4fee1fd3de9a tests: added a short description to issue numbers
Martin Geisler <mg@aragost.com>
parents: 12316
diff changeset
209 Issue332: confusing message when reverting directory
2982
890e285c52a1 revert: require --all to revert all files.
Vadim Gelfer <vadim.gelfer@gmail.com>
parents: 2272
diff changeset
210
12156
4c94b6d0fb1c tests: remove unneeded -d flags
Martin Geisler <mg@lazybytes.net>
parents: 12106
diff changeset
211 $ hg ci -A -m b
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
212 adding b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
213 created new head
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
214 $ echo foobar > b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
215 $ mkdir newdir
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
216 $ echo foo > newdir/newfile
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
217 $ hg add newdir/newfile
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
218 $ hg revert b newdir
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
219 reverting b/b (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
220 forgetting newdir/newfile (glob)
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
221 $ echo foobar > b/b
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
222 $ hg revert .
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
223 reverting b/b (glob)
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
224
5230
bfd73b567b3d When reverting a file which was renamed, also revert the old name
Brendan Cully <brendan@kublai.com>
parents: 4237
diff changeset
225
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
226 reverting a rename target should revert the source
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
227
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
228 $ hg mv a newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
229 $ hg revert newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
230 $ hg st a newa
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
231 ? newa
5230
bfd73b567b3d When reverting a file which was renamed, also revert the old name
Brendan Cully <brendan@kublai.com>
parents: 4237
diff changeset
232
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
233 $ cd ..
6031
7383384793fb revert: don't assume ignored files will be returned in the unknown list
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5230
diff changeset
234
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
235 $ hg init ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
236 $ cd ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
237 $ echo '^ignored$' > .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
238 $ echo '^ignoreddir$' >> .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
239 $ echo '^removed$' >> .hgignore
6031
7383384793fb revert: don't assume ignored files will be returned in the unknown list
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5230
diff changeset
240
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
241 $ mkdir ignoreddir
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
242 $ touch ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
243 $ touch ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
244 $ touch ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
245 $ touch removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
246
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
247 4 ignored files (we will add/commit everything)
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
248
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
249 $ hg st -A -X .hgignore
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
250 I ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
251 I ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
252 I ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
253 I removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
254 $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
6031
7383384793fb revert: don't assume ignored files will be returned in the unknown list
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5230
diff changeset
255
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
256 $ echo >> ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
257 $ echo >> ignoreddir/file
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
258 $ hg rm removed ignoreddir/removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
259
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
260 should revert ignored* and undelete *removed
6031
7383384793fb revert: don't assume ignored files will be returned in the unknown list
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 5230
diff changeset
261
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
262 $ hg revert -a --no-backup
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
263 reverting ignored
15447
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
264 reverting ignoreddir/file (glob)
9910f60a37ee tests: make (glob) on windows accept \ instead of /
Mads Kiilerich <mads@kiilerich.com>
parents: 15442
diff changeset
265 undeleting ignoreddir/removed (glob)
12106
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
266 undeleting removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
267 $ hg st -mardi
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
268
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
269 $ hg up -qC
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
270 $ echo >> ignored
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
271 $ hg rm removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
272
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
273 should silently revert the named files
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
274
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
275 $ hg revert --no-backup ignored removed
969176bec217 tests: unify test-revert
Nicolas Dumazet <nicdumz.commits@gmail.com>
parents: 6110
diff changeset
276 $ hg st -mardi