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