##// END OF EJS Templates
test-shelve: be more lenient about whitespace (issue4124)...
Tristan Seligmann -
r24233:b6bcfd16 default
parent child Browse files
Show More
@@ -1,743 +1,743 b''
1 $ cat <<EOF >> $HGRCPATH
1 $ cat <<EOF >> $HGRCPATH
2 > [extensions]
2 > [extensions]
3 > mq =
3 > mq =
4 > shelve =
4 > shelve =
5 > [defaults]
5 > [defaults]
6 > diff = --nodates --git
6 > diff = --nodates --git
7 > qnew = --date '0 0'
7 > qnew = --date '0 0'
8 > EOF
8 > EOF
9
9
10 $ hg init repo
10 $ hg init repo
11 $ cd repo
11 $ cd repo
12 $ mkdir a b
12 $ mkdir a b
13 $ echo a > a/a
13 $ echo a > a/a
14 $ echo b > b/b
14 $ echo b > b/b
15 $ echo c > c
15 $ echo c > c
16 $ echo d > d
16 $ echo d > d
17 $ echo x > x
17 $ echo x > x
18 $ hg addremove -q
18 $ hg addremove -q
19
19
20 shelving in an empty repo should be possible
20 shelving in an empty repo should be possible
21 (this tests also that editor is not invoked, if '--edit' is not
21 (this tests also that editor is not invoked, if '--edit' is not
22 specified)
22 specified)
23
23
24 $ HGEDITOR=cat hg shelve
24 $ HGEDITOR=cat hg shelve
25 shelved as default
25 shelved as default
26 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
26 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
27
27
28 $ hg unshelve
28 $ hg unshelve
29 unshelving change 'default'
29 unshelving change 'default'
30
30
31 $ hg commit -q -m 'initial commit'
31 $ hg commit -q -m 'initial commit'
32
32
33 $ hg shelve
33 $ hg shelve
34 nothing changed
34 nothing changed
35 [1]
35 [1]
36
36
37 create an mq patch - shelving should work fine with a patch applied
37 create an mq patch - shelving should work fine with a patch applied
38
38
39 $ echo n > n
39 $ echo n > n
40 $ hg add n
40 $ hg add n
41 $ hg commit n -m second
41 $ hg commit n -m second
42 $ hg qnew second.patch
42 $ hg qnew second.patch
43
43
44 shelve a change that we will delete later
44 shelve a change that we will delete later
45
45
46 $ echo a >> a/a
46 $ echo a >> a/a
47 $ hg shelve
47 $ hg shelve
48 shelved as default
48 shelved as default
49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
49 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
50
50
51 set up some more complex changes to shelve
51 set up some more complex changes to shelve
52
52
53 $ echo a >> a/a
53 $ echo a >> a/a
54 $ hg mv b b.rename
54 $ hg mv b b.rename
55 moving b/b to b.rename/b (glob)
55 moving b/b to b.rename/b (glob)
56 $ hg cp c c.copy
56 $ hg cp c c.copy
57 $ hg status -C
57 $ hg status -C
58 M a/a
58 M a/a
59 A b.rename/b
59 A b.rename/b
60 b/b
60 b/b
61 A c.copy
61 A c.copy
62 c
62 c
63 R b/b
63 R b/b
64
64
65 prevent some foot-shooting
65 prevent some foot-shooting
66
66
67 $ hg shelve -n foo/bar
67 $ hg shelve -n foo/bar
68 abort: shelved change names may not contain slashes
68 abort: shelved change names may not contain slashes
69 [255]
69 [255]
70 $ hg shelve -n .baz
70 $ hg shelve -n .baz
71 abort: shelved change names may not start with '.'
71 abort: shelved change names may not start with '.'
72 [255]
72 [255]
73
73
74 the common case - no options or filenames
74 the common case - no options or filenames
75
75
76 $ hg shelve
76 $ hg shelve
77 shelved as default-01
77 shelved as default-01
78 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
78 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
79 $ hg status -C
79 $ hg status -C
80
80
81 ensure that our shelved changes exist
81 ensure that our shelved changes exist
82
82
83 $ hg shelve -l
83 $ hg shelve -l
84 default-01 (*) changes to '[mq]: second.patch' (glob)
84 default-01 (*)* changes to '[mq]: second.patch' (glob)
85 default (*) changes to '[mq]: second.patch' (glob)
85 default (*)* changes to '[mq]: second.patch' (glob)
86
86
87 $ hg shelve -l -p default
87 $ hg shelve -l -p default
88 default (*) changes to '[mq]: second.patch' (glob)
88 default (*)* changes to '[mq]: second.patch' (glob)
89
89
90 diff --git a/a/a b/a/a
90 diff --git a/a/a b/a/a
91 --- a/a/a
91 --- a/a/a
92 +++ b/a/a
92 +++ b/a/a
93 @@ -1,1 +1,2 @@
93 @@ -1,1 +1,2 @@
94 a
94 a
95 +a
95 +a
96
96
97 $ hg shelve --list --addremove
97 $ hg shelve --list --addremove
98 abort: options '--list' and '--addremove' may not be used together
98 abort: options '--list' and '--addremove' may not be used together
99 [255]
99 [255]
100
100
101 delete our older shelved change
101 delete our older shelved change
102
102
103 $ hg shelve -d default
103 $ hg shelve -d default
104 $ hg qfinish -a -q
104 $ hg qfinish -a -q
105
105
106 local edits should not prevent a shelved change from applying
106 local edits should not prevent a shelved change from applying
107
107
108 $ printf "z\na\n" > a/a
108 $ printf "z\na\n" > a/a
109 $ hg unshelve --keep
109 $ hg unshelve --keep
110 unshelving change 'default-01'
110 unshelving change 'default-01'
111 temporarily committing pending changes (restore with 'hg unshelve --abort')
111 temporarily committing pending changes (restore with 'hg unshelve --abort')
112 rebasing shelved changes
112 rebasing shelved changes
113 rebasing 4:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
113 rebasing 4:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
114 merging a/a
114 merging a/a
115
115
116 $ hg revert --all -q
116 $ hg revert --all -q
117 $ rm a/a.orig b.rename/b c.copy
117 $ rm a/a.orig b.rename/b c.copy
118
118
119 apply it and make sure our state is as expected
119 apply it and make sure our state is as expected
120
120
121 $ hg unshelve
121 $ hg unshelve
122 unshelving change 'default-01'
122 unshelving change 'default-01'
123 $ hg status -C
123 $ hg status -C
124 M a/a
124 M a/a
125 A b.rename/b
125 A b.rename/b
126 b/b
126 b/b
127 A c.copy
127 A c.copy
128 c
128 c
129 R b/b
129 R b/b
130 $ hg shelve -l
130 $ hg shelve -l
131
131
132 $ hg unshelve
132 $ hg unshelve
133 abort: no shelved changes to apply!
133 abort: no shelved changes to apply!
134 [255]
134 [255]
135 $ hg unshelve foo
135 $ hg unshelve foo
136 abort: shelved change 'foo' not found
136 abort: shelved change 'foo' not found
137 [255]
137 [255]
138
138
139 named shelves, specific filenames, and "commit messages" should all work
139 named shelves, specific filenames, and "commit messages" should all work
140 (this tests also that editor is invoked, if '--edit' is specified)
140 (this tests also that editor is invoked, if '--edit' is specified)
141
141
142 $ hg status -C
142 $ hg status -C
143 M a/a
143 M a/a
144 A b.rename/b
144 A b.rename/b
145 b/b
145 b/b
146 A c.copy
146 A c.copy
147 c
147 c
148 R b/b
148 R b/b
149 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
149 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
150 wat
150 wat
151
151
152
152
153 HG: Enter commit message. Lines beginning with 'HG:' are removed.
153 HG: Enter commit message. Lines beginning with 'HG:' are removed.
154 HG: Leave message empty to abort commit.
154 HG: Leave message empty to abort commit.
155 HG: --
155 HG: --
156 HG: user: shelve@localhost
156 HG: user: shelve@localhost
157 HG: branch 'default'
157 HG: branch 'default'
158 HG: changed a/a
158 HG: changed a/a
159
159
160 expect "a" to no longer be present, but status otherwise unchanged
160 expect "a" to no longer be present, but status otherwise unchanged
161
161
162 $ hg status -C
162 $ hg status -C
163 A b.rename/b
163 A b.rename/b
164 b/b
164 b/b
165 A c.copy
165 A c.copy
166 c
166 c
167 R b/b
167 R b/b
168 $ hg shelve -l --stat
168 $ hg shelve -l --stat
169 wibble (*) wat (glob)
169 wibble (*) wat (glob)
170 a/a | 1 +
170 a/a | 1 +
171 1 files changed, 1 insertions(+), 0 deletions(-)
171 1 files changed, 1 insertions(+), 0 deletions(-)
172
172
173 and now "a/a" should reappear
173 and now "a/a" should reappear
174
174
175 $ cd a
175 $ cd a
176 $ hg unshelve -q wibble
176 $ hg unshelve -q wibble
177 $ cd ..
177 $ cd ..
178 $ hg status -C
178 $ hg status -C
179 M a/a
179 M a/a
180 A b.rename/b
180 A b.rename/b
181 b/b
181 b/b
182 A c.copy
182 A c.copy
183 c
183 c
184 R b/b
184 R b/b
185
185
186 cause unshelving to result in a merge with 'a' conflicting
186 cause unshelving to result in a merge with 'a' conflicting
187
187
188 $ hg shelve -q
188 $ hg shelve -q
189 $ echo c>>a/a
189 $ echo c>>a/a
190 $ hg commit -m second
190 $ hg commit -m second
191 $ hg tip --template '{files}\n'
191 $ hg tip --template '{files}\n'
192 a/a
192 a/a
193
193
194 add an unrelated change that should be preserved
194 add an unrelated change that should be preserved
195
195
196 $ mkdir foo
196 $ mkdir foo
197 $ echo foo > foo/foo
197 $ echo foo > foo/foo
198 $ hg add foo/foo
198 $ hg add foo/foo
199
199
200 force a conflicted merge to occur
200 force a conflicted merge to occur
201
201
202 $ hg unshelve
202 $ hg unshelve
203 unshelving change 'default'
203 unshelving change 'default'
204 temporarily committing pending changes (restore with 'hg unshelve --abort')
204 temporarily committing pending changes (restore with 'hg unshelve --abort')
205 rebasing shelved changes
205 rebasing shelved changes
206 rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
206 rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
207 merging a/a
207 merging a/a
208 warning: conflicts during merge.
208 warning: conflicts during merge.
209 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
209 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
210 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
210 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
211 [1]
211 [1]
212
212
213 ensure that we have a merge with unresolved conflicts
213 ensure that we have a merge with unresolved conflicts
214
214
215 $ hg heads -q --template '{rev}\n'
215 $ hg heads -q --template '{rev}\n'
216 5
216 5
217 4
217 4
218 $ hg parents -q --template '{rev}\n'
218 $ hg parents -q --template '{rev}\n'
219 4
219 4
220 5
220 5
221 $ hg status
221 $ hg status
222 M a/a
222 M a/a
223 M b.rename/b
223 M b.rename/b
224 M c.copy
224 M c.copy
225 R b/b
225 R b/b
226 ? a/a.orig
226 ? a/a.orig
227 $ hg diff
227 $ hg diff
228 diff --git a/a/a b/a/a
228 diff --git a/a/a b/a/a
229 --- a/a/a
229 --- a/a/a
230 +++ b/a/a
230 +++ b/a/a
231 @@ -1,2 +1,6 @@
231 @@ -1,2 +1,6 @@
232 a
232 a
233 +<<<<<<< dest: * - shelve: pending changes temporary commit (glob)
233 +<<<<<<< dest: * - shelve: pending changes temporary commit (glob)
234 c
234 c
235 +=======
235 +=======
236 +a
236 +a
237 +>>>>>>> source: 4702e8911fe0 - shelve: changes to '[mq]: second.patch'
237 +>>>>>>> source: 4702e8911fe0 - shelve: changes to '[mq]: second.patch'
238 diff --git a/b/b b/b.rename/b
238 diff --git a/b/b b/b.rename/b
239 rename from b/b
239 rename from b/b
240 rename to b.rename/b
240 rename to b.rename/b
241 diff --git a/c b/c.copy
241 diff --git a/c b/c.copy
242 copy from c
242 copy from c
243 copy to c.copy
243 copy to c.copy
244 $ hg resolve -l
244 $ hg resolve -l
245 U a/a
245 U a/a
246
246
247 $ hg shelve
247 $ hg shelve
248 abort: unshelve already in progress
248 abort: unshelve already in progress
249 (use 'hg unshelve --continue' or 'hg unshelve --abort')
249 (use 'hg unshelve --continue' or 'hg unshelve --abort')
250 [255]
250 [255]
251
251
252 abort the unshelve and be happy
252 abort the unshelve and be happy
253
253
254 $ hg status
254 $ hg status
255 M a/a
255 M a/a
256 M b.rename/b
256 M b.rename/b
257 M c.copy
257 M c.copy
258 R b/b
258 R b/b
259 ? a/a.orig
259 ? a/a.orig
260 $ hg unshelve -a
260 $ hg unshelve -a
261 rebase aborted
261 rebase aborted
262 unshelve of 'default' aborted
262 unshelve of 'default' aborted
263 $ hg heads -q
263 $ hg heads -q
264 3:2e69b451d1ea
264 3:2e69b451d1ea
265 $ hg parents
265 $ hg parents
266 changeset: 3:2e69b451d1ea
266 changeset: 3:2e69b451d1ea
267 tag: tip
267 tag: tip
268 user: test
268 user: test
269 date: Thu Jan 01 00:00:00 1970 +0000
269 date: Thu Jan 01 00:00:00 1970 +0000
270 summary: second
270 summary: second
271
271
272 $ hg resolve -l
272 $ hg resolve -l
273 $ hg status
273 $ hg status
274 A foo/foo
274 A foo/foo
275 ? a/a.orig
275 ? a/a.orig
276
276
277 try to continue with no unshelve underway
277 try to continue with no unshelve underway
278
278
279 $ hg unshelve -c
279 $ hg unshelve -c
280 abort: no unshelve operation underway
280 abort: no unshelve operation underway
281 [255]
281 [255]
282 $ hg status
282 $ hg status
283 A foo/foo
283 A foo/foo
284 ? a/a.orig
284 ? a/a.orig
285
285
286 redo the unshelve to get a conflict
286 redo the unshelve to get a conflict
287
287
288 $ hg unshelve -q
288 $ hg unshelve -q
289 warning: conflicts during merge.
289 warning: conflicts during merge.
290 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
290 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
291 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
291 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
292 [1]
292 [1]
293
293
294 attempt to continue
294 attempt to continue
295
295
296 $ hg unshelve -c
296 $ hg unshelve -c
297 abort: unresolved conflicts, can't continue
297 abort: unresolved conflicts, can't continue
298 (see 'hg resolve', then 'hg unshelve --continue')
298 (see 'hg resolve', then 'hg unshelve --continue')
299 [255]
299 [255]
300
300
301 $ hg revert -r . a/a
301 $ hg revert -r . a/a
302 $ hg resolve -m a/a
302 $ hg resolve -m a/a
303 (no more unresolved files)
303 (no more unresolved files)
304
304
305 $ hg commit -m 'commit while unshelve in progress'
305 $ hg commit -m 'commit while unshelve in progress'
306 abort: unshelve already in progress
306 abort: unshelve already in progress
307 (use 'hg unshelve --continue' or 'hg unshelve --abort')
307 (use 'hg unshelve --continue' or 'hg unshelve --abort')
308 [255]
308 [255]
309
309
310 $ hg unshelve -c
310 $ hg unshelve -c
311 rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
311 rebasing 5:4702e8911fe0 "changes to '[mq]: second.patch'" (tip)
312 unshelve of 'default' complete
312 unshelve of 'default' complete
313
313
314 ensure the repo is as we hope
314 ensure the repo is as we hope
315
315
316 $ hg parents
316 $ hg parents
317 changeset: 3:2e69b451d1ea
317 changeset: 3:2e69b451d1ea
318 tag: tip
318 tag: tip
319 user: test
319 user: test
320 date: Thu Jan 01 00:00:00 1970 +0000
320 date: Thu Jan 01 00:00:00 1970 +0000
321 summary: second
321 summary: second
322
322
323 $ hg heads -q
323 $ hg heads -q
324 3:2e69b451d1ea
324 3:2e69b451d1ea
325
325
326 $ hg status -C
326 $ hg status -C
327 A b.rename/b
327 A b.rename/b
328 b/b
328 b/b
329 A c.copy
329 A c.copy
330 c
330 c
331 A foo/foo
331 A foo/foo
332 R b/b
332 R b/b
333 ? a/a.orig
333 ? a/a.orig
334
334
335 there should be no shelves left
335 there should be no shelves left
336
336
337 $ hg shelve -l
337 $ hg shelve -l
338
338
339 #if execbit
339 #if execbit
340
340
341 ensure that metadata-only changes are shelved
341 ensure that metadata-only changes are shelved
342
342
343 $ chmod +x a/a
343 $ chmod +x a/a
344 $ hg shelve -q -n execbit a/a
344 $ hg shelve -q -n execbit a/a
345 $ hg status a/a
345 $ hg status a/a
346 $ hg unshelve -q execbit
346 $ hg unshelve -q execbit
347 $ hg status a/a
347 $ hg status a/a
348 M a/a
348 M a/a
349 $ hg revert a/a
349 $ hg revert a/a
350
350
351 #endif
351 #endif
352
352
353 #if symlink
353 #if symlink
354
354
355 $ rm a/a
355 $ rm a/a
356 $ ln -s foo a/a
356 $ ln -s foo a/a
357 $ hg shelve -q -n symlink a/a
357 $ hg shelve -q -n symlink a/a
358 $ hg status a/a
358 $ hg status a/a
359 $ hg unshelve -q symlink
359 $ hg unshelve -q symlink
360 $ hg status a/a
360 $ hg status a/a
361 M a/a
361 M a/a
362 $ hg revert a/a
362 $ hg revert a/a
363
363
364 #endif
364 #endif
365
365
366 set up another conflict between a commit and a shelved change
366 set up another conflict between a commit and a shelved change
367
367
368 $ hg revert -q -C -a
368 $ hg revert -q -C -a
369 $ rm a/a.orig b.rename/b c.copy
369 $ rm a/a.orig b.rename/b c.copy
370 $ echo a >> a/a
370 $ echo a >> a/a
371 $ hg shelve -q
371 $ hg shelve -q
372 $ echo x >> a/a
372 $ echo x >> a/a
373 $ hg ci -m 'create conflict'
373 $ hg ci -m 'create conflict'
374 $ hg add foo/foo
374 $ hg add foo/foo
375
375
376 if we resolve a conflict while unshelving, the unshelve should succeed
376 if we resolve a conflict while unshelving, the unshelve should succeed
377
377
378 $ HGMERGE=true hg unshelve
378 $ HGMERGE=true hg unshelve
379 unshelving change 'default'
379 unshelving change 'default'
380 temporarily committing pending changes (restore with 'hg unshelve --abort')
380 temporarily committing pending changes (restore with 'hg unshelve --abort')
381 rebasing shelved changes
381 rebasing shelved changes
382 rebasing 6:c5e6910e7601 "changes to 'second'" (tip)
382 rebasing 6:c5e6910e7601 "changes to 'second'" (tip)
383 merging a/a
383 merging a/a
384 note: rebase of 6:c5e6910e7601 created no changes to commit
384 note: rebase of 6:c5e6910e7601 created no changes to commit
385 $ hg parents -q
385 $ hg parents -q
386 4:33f7f61e6c5e
386 4:33f7f61e6c5e
387 $ hg shelve -l
387 $ hg shelve -l
388 $ hg status
388 $ hg status
389 A foo/foo
389 A foo/foo
390 $ cat a/a
390 $ cat a/a
391 a
391 a
392 c
392 c
393 x
393 x
394
394
395 test keep and cleanup
395 test keep and cleanup
396
396
397 $ hg shelve
397 $ hg shelve
398 shelved as default
398 shelved as default
399 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
399 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
400 $ hg shelve --list
400 $ hg shelve --list
401 default (*) changes to 'create conflict' (glob)
401 default (*) changes to 'create conflict' (glob)
402 $ hg unshelve --keep
402 $ hg unshelve --keep
403 unshelving change 'default'
403 unshelving change 'default'
404 $ hg shelve --list
404 $ hg shelve --list
405 default (*) changes to 'create conflict' (glob)
405 default (*) changes to 'create conflict' (glob)
406 $ hg shelve --cleanup
406 $ hg shelve --cleanup
407 $ hg shelve --list
407 $ hg shelve --list
408
408
409 $ hg shelve --cleanup --delete
409 $ hg shelve --cleanup --delete
410 abort: options '--cleanup' and '--delete' may not be used together
410 abort: options '--cleanup' and '--delete' may not be used together
411 [255]
411 [255]
412 $ hg shelve --cleanup --patch
412 $ hg shelve --cleanup --patch
413 abort: options '--cleanup' and '--patch' may not be used together
413 abort: options '--cleanup' and '--patch' may not be used together
414 [255]
414 [255]
415 $ hg shelve --cleanup --message MESSAGE
415 $ hg shelve --cleanup --message MESSAGE
416 abort: options '--cleanup' and '--message' may not be used together
416 abort: options '--cleanup' and '--message' may not be used together
417 [255]
417 [255]
418
418
419 test bookmarks
419 test bookmarks
420
420
421 $ hg bookmark test
421 $ hg bookmark test
422 $ hg bookmark
422 $ hg bookmark
423 * test 4:33f7f61e6c5e
423 * test 4:33f7f61e6c5e
424 $ hg shelve
424 $ hg shelve
425 shelved as test
425 shelved as test
426 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
426 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
427 $ hg bookmark
427 $ hg bookmark
428 * test 4:33f7f61e6c5e
428 * test 4:33f7f61e6c5e
429 $ hg unshelve
429 $ hg unshelve
430 unshelving change 'test'
430 unshelving change 'test'
431 $ hg bookmark
431 $ hg bookmark
432 * test 4:33f7f61e6c5e
432 * test 4:33f7f61e6c5e
433
433
434 shelve should still work even if mq is disabled
434 shelve should still work even if mq is disabled
435
435
436 $ hg --config extensions.mq=! shelve
436 $ hg --config extensions.mq=! shelve
437 shelved as test
437 shelved as test
438 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
438 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
439 $ hg --config extensions.mq=! shelve --list
439 $ hg --config extensions.mq=! shelve --list
440 test (*) changes to 'create conflict' (glob)
440 test (*) changes to 'create conflict' (glob)
441 $ hg --config extensions.mq=! unshelve
441 $ hg --config extensions.mq=! unshelve
442 unshelving change 'test'
442 unshelving change 'test'
443
443
444 shelve should leave dirstate clean (issue4055)
444 shelve should leave dirstate clean (issue4055)
445
445
446 $ cd ..
446 $ cd ..
447 $ hg init shelverebase
447 $ hg init shelverebase
448 $ cd shelverebase
448 $ cd shelverebase
449 $ printf 'x\ny\n' > x
449 $ printf 'x\ny\n' > x
450 $ echo z > z
450 $ echo z > z
451 $ hg commit -Aqm xy
451 $ hg commit -Aqm xy
452 $ echo z >> x
452 $ echo z >> x
453 $ hg commit -Aqm z
453 $ hg commit -Aqm z
454 $ hg up 0
454 $ hg up 0
455 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
455 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
456 $ printf 'a\nx\ny\nz\n' > x
456 $ printf 'a\nx\ny\nz\n' > x
457 $ hg commit -Aqm xyz
457 $ hg commit -Aqm xyz
458 $ echo c >> z
458 $ echo c >> z
459 $ hg shelve
459 $ hg shelve
460 shelved as default
460 shelved as default
461 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
461 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
462 $ hg rebase -d 1 --config extensions.rebase=
462 $ hg rebase -d 1 --config extensions.rebase=
463 rebasing 2:323bfa07f744 "xyz" (tip)
463 rebasing 2:323bfa07f744 "xyz" (tip)
464 merging x
464 merging x
465 saved backup bundle to $TESTTMP/shelverebase/.hg/strip-backup/323bfa07f744-78114325-backup.hg (glob)
465 saved backup bundle to $TESTTMP/shelverebase/.hg/strip-backup/323bfa07f744-78114325-backup.hg (glob)
466 $ hg unshelve
466 $ hg unshelve
467 unshelving change 'default'
467 unshelving change 'default'
468 rebasing shelved changes
468 rebasing shelved changes
469 rebasing 4:b8fefe789ed0 "changes to 'xyz'" (tip)
469 rebasing 4:b8fefe789ed0 "changes to 'xyz'" (tip)
470 $ hg status
470 $ hg status
471 M z
471 M z
472
472
473 $ cd ..
473 $ cd ..
474
474
475 shelve should only unshelve pending changes (issue4068)
475 shelve should only unshelve pending changes (issue4068)
476
476
477 $ hg init onlypendingchanges
477 $ hg init onlypendingchanges
478 $ cd onlypendingchanges
478 $ cd onlypendingchanges
479 $ touch a
479 $ touch a
480 $ hg ci -Aqm a
480 $ hg ci -Aqm a
481 $ touch b
481 $ touch b
482 $ hg ci -Aqm b
482 $ hg ci -Aqm b
483 $ hg up -q 0
483 $ hg up -q 0
484 $ touch c
484 $ touch c
485 $ hg ci -Aqm c
485 $ hg ci -Aqm c
486
486
487 $ touch d
487 $ touch d
488 $ hg add d
488 $ hg add d
489 $ hg shelve
489 $ hg shelve
490 shelved as default
490 shelved as default
491 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
491 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
492 $ hg up -q 1
492 $ hg up -q 1
493 $ hg unshelve
493 $ hg unshelve
494 unshelving change 'default'
494 unshelving change 'default'
495 rebasing shelved changes
495 rebasing shelved changes
496 rebasing 3:0cae6656c016 "changes to 'c'" (tip)
496 rebasing 3:0cae6656c016 "changes to 'c'" (tip)
497 $ hg status
497 $ hg status
498 A d
498 A d
499
499
500 unshelve should work on an ancestor of the original commit
500 unshelve should work on an ancestor of the original commit
501
501
502 $ hg shelve
502 $ hg shelve
503 shelved as default
503 shelved as default
504 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
504 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
505 $ hg up 0
505 $ hg up 0
506 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
506 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
507 $ hg unshelve
507 $ hg unshelve
508 unshelving change 'default'
508 unshelving change 'default'
509 rebasing shelved changes
509 rebasing shelved changes
510 rebasing 3:be58f65f55fb "changes to 'b'" (tip)
510 rebasing 3:be58f65f55fb "changes to 'b'" (tip)
511 $ hg status
511 $ hg status
512 A d
512 A d
513
513
514 test bug 4073 we need to enable obsolete markers for it
514 test bug 4073 we need to enable obsolete markers for it
515
515
516 $ cat >> $HGRCPATH << EOF
516 $ cat >> $HGRCPATH << EOF
517 > [experimental]
517 > [experimental]
518 > evolution=createmarkers
518 > evolution=createmarkers
519 > EOF
519 > EOF
520 $ hg shelve
520 $ hg shelve
521 shelved as default
521 shelved as default
522 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
522 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
523 $ hg debugobsolete `hg --debug id -i -r 1`
523 $ hg debugobsolete `hg --debug id -i -r 1`
524 $ hg unshelve
524 $ hg unshelve
525 unshelving change 'default'
525 unshelving change 'default'
526
526
527 unshelve should leave unknown files alone (issue4113)
527 unshelve should leave unknown files alone (issue4113)
528
528
529 $ echo e > e
529 $ echo e > e
530 $ hg shelve
530 $ hg shelve
531 shelved as default
531 shelved as default
532 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
532 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
533 $ hg status
533 $ hg status
534 ? e
534 ? e
535 $ hg unshelve
535 $ hg unshelve
536 unshelving change 'default'
536 unshelving change 'default'
537 $ hg status
537 $ hg status
538 A d
538 A d
539 ? e
539 ? e
540 $ cat e
540 $ cat e
541 e
541 e
542
542
543 unshelve should keep a copy of unknown files
543 unshelve should keep a copy of unknown files
544
544
545 $ hg add e
545 $ hg add e
546 $ hg shelve
546 $ hg shelve
547 shelved as default
547 shelved as default
548 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
548 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
549 $ echo z > e
549 $ echo z > e
550 $ hg unshelve
550 $ hg unshelve
551 unshelving change 'default'
551 unshelving change 'default'
552 $ cat e
552 $ cat e
553 e
553 e
554 $ cat e.orig
554 $ cat e.orig
555 z
555 z
556
556
557
557
558 unshelve and conflicts with tracked and untracked files
558 unshelve and conflicts with tracked and untracked files
559
559
560 preparing:
560 preparing:
561
561
562 $ rm *.orig
562 $ rm *.orig
563 $ hg ci -qm 'commit stuff'
563 $ hg ci -qm 'commit stuff'
564 $ hg phase -p null:
564 $ hg phase -p null:
565
565
566 no other changes - no merge:
566 no other changes - no merge:
567
567
568 $ echo f > f
568 $ echo f > f
569 $ hg add f
569 $ hg add f
570 $ hg shelve
570 $ hg shelve
571 shelved as default
571 shelved as default
572 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
572 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
573 $ echo g > f
573 $ echo g > f
574 $ hg unshelve
574 $ hg unshelve
575 unshelving change 'default'
575 unshelving change 'default'
576 $ hg st
576 $ hg st
577 A f
577 A f
578 ? f.orig
578 ? f.orig
579 $ cat f
579 $ cat f
580 f
580 f
581 $ cat f.orig
581 $ cat f.orig
582 g
582 g
583
583
584 other uncommitted changes - merge:
584 other uncommitted changes - merge:
585
585
586 $ hg st
586 $ hg st
587 A f
587 A f
588 ? f.orig
588 ? f.orig
589 $ hg shelve
589 $ hg shelve
590 shelved as default
590 shelved as default
591 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
591 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
592 $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()'
592 $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()'
593 o 4 changes to 'commit stuff' shelve@localhost
593 o 4 changes to 'commit stuff' shelve@localhost
594 |
594 |
595 $ hg log -G --template '{rev} {desc|firstline} {author}'
595 $ hg log -G --template '{rev} {desc|firstline} {author}'
596 @ 3 commit stuff test
596 @ 3 commit stuff test
597 |
597 |
598 | o 2 c test
598 | o 2 c test
599 |/
599 |/
600 o 0 a test
600 o 0 a test
601
601
602 $ mv f.orig f
602 $ mv f.orig f
603 $ echo 1 > a
603 $ echo 1 > a
604 $ hg unshelve --date '1073741824 0'
604 $ hg unshelve --date '1073741824 0'
605 unshelving change 'default'
605 unshelving change 'default'
606 temporarily committing pending changes (restore with 'hg unshelve --abort')
606 temporarily committing pending changes (restore with 'hg unshelve --abort')
607 rebasing shelved changes
607 rebasing shelved changes
608 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
608 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
609 merging f
609 merging f
610 warning: conflicts during merge.
610 warning: conflicts during merge.
611 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
611 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
612 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
612 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
613 [1]
613 [1]
614 $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}'
614 $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}'
615 @ 5 changes to 'commit stuff' shelve@localhost 1970-01-01 00:00 +0000
615 @ 5 changes to 'commit stuff' shelve@localhost 1970-01-01 00:00 +0000
616 |
616 |
617 | @ 4 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000
617 | @ 4 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000
618 |/
618 |/
619 o 3 commit stuff test 1970-01-01 00:00 +0000
619 o 3 commit stuff test 1970-01-01 00:00 +0000
620 |
620 |
621 | o 2 c test 1970-01-01 00:00 +0000
621 | o 2 c test 1970-01-01 00:00 +0000
622 |/
622 |/
623 o 0 a test 1970-01-01 00:00 +0000
623 o 0 a test 1970-01-01 00:00 +0000
624
624
625 $ hg st
625 $ hg st
626 M f
626 M f
627 ? f.orig
627 ? f.orig
628 $ cat f
628 $ cat f
629 <<<<<<< dest: 5f6b880e719b - shelve: pending changes temporary commit
629 <<<<<<< dest: 5f6b880e719b - shelve: pending changes temporary commit
630 g
630 g
631 =======
631 =======
632 f
632 f
633 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
633 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
634 $ cat f.orig
634 $ cat f.orig
635 g
635 g
636 $ hg unshelve --abort
636 $ hg unshelve --abort
637 rebase aborted
637 rebase aborted
638 unshelve of 'default' aborted
638 unshelve of 'default' aborted
639 $ hg st
639 $ hg st
640 M a
640 M a
641 ? f.orig
641 ? f.orig
642 $ cat f.orig
642 $ cat f.orig
643 g
643 g
644 $ hg unshelve
644 $ hg unshelve
645 unshelving change 'default'
645 unshelving change 'default'
646 temporarily committing pending changes (restore with 'hg unshelve --abort')
646 temporarily committing pending changes (restore with 'hg unshelve --abort')
647 rebasing shelved changes
647 rebasing shelved changes
648 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
648 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
649 $ hg st
649 $ hg st
650 M a
650 M a
651 A f
651 A f
652 ? f.orig
652 ? f.orig
653
653
654 other committed changes - merge:
654 other committed changes - merge:
655
655
656 $ hg shelve f
656 $ hg shelve f
657 shelved as default
657 shelved as default
658 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
658 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
659 $ hg ci a -m 'intermediate other change'
659 $ hg ci a -m 'intermediate other change'
660 $ mv f.orig f
660 $ mv f.orig f
661 $ hg unshelve
661 $ hg unshelve
662 unshelving change 'default'
662 unshelving change 'default'
663 rebasing shelved changes
663 rebasing shelved changes
664 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
664 rebasing 5:23b29cada8ba "changes to 'commit stuff'" (tip)
665 merging f
665 merging f
666 warning: conflicts during merge.
666 warning: conflicts during merge.
667 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
667 merging f incomplete! (edit conflicts, then use 'hg resolve --mark')
668 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
668 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
669 [1]
669 [1]
670 $ hg st
670 $ hg st
671 M f
671 M f
672 ? f.orig
672 ? f.orig
673 $ cat f
673 $ cat f
674 <<<<<<< dest: * - test: intermediate other change (glob)
674 <<<<<<< dest: * - test: intermediate other change (glob)
675 g
675 g
676 =======
676 =======
677 f
677 f
678 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
678 >>>>>>> source: 23b29cada8ba - shelve: changes to 'commit stuff'
679 $ cat f.orig
679 $ cat f.orig
680 g
680 g
681 $ hg unshelve --abort
681 $ hg unshelve --abort
682 rebase aborted
682 rebase aborted
683 unshelve of 'default' aborted
683 unshelve of 'default' aborted
684 $ hg st
684 $ hg st
685 ? f.orig
685 ? f.orig
686 $ cat f.orig
686 $ cat f.orig
687 g
687 g
688 $ hg shelve --delete default
688 $ hg shelve --delete default
689
689
690 Recreate some conflict again
690 Recreate some conflict again
691
691
692 $ cd ../repo
692 $ cd ../repo
693 $ hg up -C -r 3
693 $ hg up -C -r 3
694 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
694 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
695 (leaving bookmark test)
695 (leaving bookmark test)
696 $ echo y >> a/a
696 $ echo y >> a/a
697 $ hg shelve
697 $ hg shelve
698 shelved as default
698 shelved as default
699 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
699 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
700 $ hg up test
700 $ hg up test
701 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
701 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
702 (activating bookmark test)
702 (activating bookmark test)
703 $ hg unshelve
703 $ hg unshelve
704 unshelving change 'default'
704 unshelving change 'default'
705 rebasing shelved changes
705 rebasing shelved changes
706 rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
706 rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
707 merging a/a
707 merging a/a
708 warning: conflicts during merge.
708 warning: conflicts during merge.
709 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
709 merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark')
710 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
710 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
711 [1]
711 [1]
712
712
713 Test that resolving all conflicts in one direction (so that the rebase
713 Test that resolving all conflicts in one direction (so that the rebase
714 is a no-op), works (issue4398)
714 is a no-op), works (issue4398)
715
715
716 $ hg revert -a -r .
716 $ hg revert -a -r .
717 reverting a/a (glob)
717 reverting a/a (glob)
718 $ hg resolve -m a/a
718 $ hg resolve -m a/a
719 (no more unresolved files)
719 (no more unresolved files)
720 $ hg unshelve -c
720 $ hg unshelve -c
721 rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
721 rebasing 5:4b555fdb4e96 "changes to 'second'" (tip)
722 note: rebase of 5:4b555fdb4e96 created no changes to commit
722 note: rebase of 5:4b555fdb4e96 created no changes to commit
723 unshelve of 'default' complete
723 unshelve of 'default' complete
724 $ hg diff
724 $ hg diff
725 $ hg status
725 $ hg status
726 ? a/a.orig
726 ? a/a.orig
727 ? foo/foo
727 ? foo/foo
728 $ hg summary
728 $ hg summary
729 parent: 4:33f7f61e6c5e tip
729 parent: 4:33f7f61e6c5e tip
730 create conflict
730 create conflict
731 branch: default
731 branch: default
732 bookmarks: *test
732 bookmarks: *test
733 commit: 2 unknown (clean)
733 commit: 2 unknown (clean)
734 update: (current)
734 update: (current)
735
735
736 $ hg shelve --delete --stat
736 $ hg shelve --delete --stat
737 abort: options '--delete' and '--stat' may not be used together
737 abort: options '--delete' and '--stat' may not be used together
738 [255]
738 [255]
739 $ hg shelve --delete --name NAME
739 $ hg shelve --delete --name NAME
740 abort: options '--delete' and '--name' may not be used together
740 abort: options '--delete' and '--name' may not be used together
741 [255]
741 [255]
742
742
743 $ cd ..
743 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now