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