##// END OF EJS Templates
test-revert: add revert --all case when nothing changed...
Adrian Buehlmann -
r14767:aab323df stable
parent child Browse files
Show More
@@ -1,273 +1,274 b''
1 1 $ hg init repo
2 2 $ cd repo
3 3 $ echo 123 > a
4 4 $ echo 123 > c
5 5 $ echo 123 > e
6 6 $ hg add a c e
7 7 $ hg commit -m "first" a c e
8 8
9 9 nothing changed
10 10
11 11 $ hg revert
12 12 abort: no files or directories specified
13 13 (use --all to revert all files)
14 14 [255]
15 $ hg revert --all
15 16
16 17 $ echo 123 > b
17 18
18 19 should show b unknown
19 20
20 21 $ hg status
21 22 ? b
22 23 $ echo 12 > c
23 24
24 25 should show b unknown and c modified
25 26
26 27 $ hg status
27 28 M c
28 29 ? b
29 30 $ hg add b
30 31
31 32 should show b added and c modified
32 33
33 34 $ hg status
34 35 M c
35 36 A b
36 37 $ hg rm a
37 38
38 39 should show a removed, b added and c modified
39 40
40 41 $ hg status
41 42 M c
42 43 A b
43 44 R a
44 45 $ hg revert a
45 46
46 47 should show b added, copy saved, and c modified
47 48
48 49 $ hg status
49 50 M c
50 51 A b
51 52 $ hg revert b
52 53
53 54 should show b unknown, and c modified
54 55
55 56 $ hg status
56 57 M c
57 58 ? b
58 59 $ hg revert --no-backup c
59 60
60 61 should show unknown: b
61 62
62 63 $ hg status
63 64 ? b
64 65 $ hg add b
65 66
66 67 should show b added
67 68
68 69 $ hg status b
69 70 A b
70 71 $ rm b
71 72
72 73 should show b deleted
73 74
74 75 $ hg status b
75 76 ! b
76 77 $ hg revert -v b
77 78 forgetting b
78 79
79 80 should not find b
80 81
81 82 $ hg status b
82 83 b: No such file or directory
83 84
84 85 should show a c e
85 86
86 87 $ ls
87 88 a
88 89 c
89 90 e
90 91
91 92 should verbosely save backup to e.orig
92 93
93 94 $ echo z > e
94 95 $ hg revert --all -v
95 96 saving current version of e as e.orig
96 97 reverting e
97 98
98 99 should say no changes needed
99 100
100 101 $ hg revert a
101 102 no changes needed to a
102 103
103 104 should say file not managed
104 105
105 106 $ echo q > q
106 107 $ hg revert q
107 108 file not managed: q
108 109 $ rm q
109 110
110 111 should say file not found
111 112
112 113 $ hg revert notfound
113 114 notfound: no such file in rev 334a9e57682c
114 115 $ touch d
115 116 $ hg add d
116 117 $ hg rm a
117 118 $ hg commit -m "second"
118 119 $ echo z > z
119 120 $ hg add z
120 121 $ hg st
121 122 A z
122 123 ? e.orig
123 124
124 125 should add a, remove d, forget z
125 126
126 127 $ hg revert --all -r0
127 128 adding a
128 129 removing d
129 130 forgetting z
130 131
131 132 should forget a, undelete d
132 133
133 134 $ hg revert --all -rtip
134 135 forgetting a
135 136 undeleting d
136 137 $ rm a *.orig
137 138
138 139 should silently add a
139 140
140 141 $ hg revert -r0 a
141 142 $ hg st a
142 143 A a
143 144 $ hg rm d
144 145 $ hg st d
145 146 R d
146 147
147 148 should silently keep d removed
148 149
149 150 $ hg revert -r0 d
150 151 $ hg st d
151 152 R d
152 153
153 154 $ hg update -C
154 155 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
155 156 $ chmod +x c
156 157 $ hg revert --all
157 158 reverting c
158 159
159 160 should print non-executable
160 161
161 162 $ test -x c || echo non-executable
162 163 non-executable
163 164
164 165 $ chmod +x c
165 166 $ hg commit -m exe
166 167
167 168 $ chmod -x c
168 169 $ hg revert --all
169 170 reverting c
170 171
171 172 should print executable
172 173
173 174 $ test -x c && echo executable
174 175 executable
175 176
176 177 $ cd ..
177 178
178 179
179 180 Issue241: update and revert produces inconsistent repositories
180 181
181 182 $ hg init a
182 183 $ cd a
183 184 $ echo a >> a
184 185 $ hg commit -A -d '1 0' -m a
185 186 adding a
186 187 $ echo a >> a
187 188 $ hg commit -d '2 0' -m a
188 189 $ hg update 0
189 190 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
190 191 $ mkdir b
191 192 $ echo b > b/b
192 193
193 194 should fail - no arguments
194 195
195 196 $ hg revert -rtip
196 197 abort: no files or directories specified
197 198 (use --all to revert all files, or 'hg update 1' to update)
198 199 [255]
199 200
200 201 should succeed
201 202
202 203 $ hg revert --all -rtip
203 204 reverting a
204 205
205 206
206 207 Issue332: confusing message when reverting directory
207 208
208 209 $ hg ci -A -m b
209 210 adding b/b
210 211 created new head
211 212 $ echo foobar > b/b
212 213 $ mkdir newdir
213 214 $ echo foo > newdir/newfile
214 215 $ hg add newdir/newfile
215 216 $ hg revert b newdir
216 217 reverting b/b
217 218 forgetting newdir/newfile
218 219 $ echo foobar > b/b
219 220 $ hg revert .
220 221 reverting b/b
221 222
222 223
223 224 reverting a rename target should revert the source
224 225
225 226 $ hg mv a newa
226 227 $ hg revert newa
227 228 $ hg st a newa
228 229 ? newa
229 230
230 231 $ cd ..
231 232
232 233 $ hg init ignored
233 234 $ cd ignored
234 235 $ echo '^ignored$' > .hgignore
235 236 $ echo '^ignoreddir$' >> .hgignore
236 237 $ echo '^removed$' >> .hgignore
237 238
238 239 $ mkdir ignoreddir
239 240 $ touch ignoreddir/file
240 241 $ touch ignoreddir/removed
241 242 $ touch ignored
242 243 $ touch removed
243 244
244 245 4 ignored files (we will add/commit everything)
245 246
246 247 $ hg st -A -X .hgignore
247 248 I ignored
248 249 I ignoreddir/file
249 250 I ignoreddir/removed
250 251 I removed
251 252 $ hg ci -qAm 'add files' ignored ignoreddir/file ignoreddir/removed removed
252 253
253 254 $ echo >> ignored
254 255 $ echo >> ignoreddir/file
255 256 $ hg rm removed ignoreddir/removed
256 257
257 258 should revert ignored* and undelete *removed
258 259
259 260 $ hg revert -a --no-backup
260 261 reverting ignored
261 262 reverting ignoreddir/file
262 263 undeleting ignoreddir/removed
263 264 undeleting removed
264 265 $ hg st -mardi
265 266
266 267 $ hg up -qC
267 268 $ echo >> ignored
268 269 $ hg rm removed
269 270
270 271 should silently revert the named files
271 272
272 273 $ hg revert --no-backup ignored removed
273 274 $ hg st -mardi
General Comments 0
You need to be logged in to leave comments. Login now