##// END OF EJS Templates
tests: add test showing crash when shelving ghosted rename target...
Martin von Zweigbergk -
r44690:ae4d729e default
parent child Browse files
Show More
@@ -1,1491 +1,1515
1 #testcases stripbased phasebased
1 #testcases stripbased phasebased
2
2
3 $ cat <<EOF >> $HGRCPATH
3 $ cat <<EOF >> $HGRCPATH
4 > [extensions]
4 > [extensions]
5 > mq =
5 > mq =
6 > [defaults]
6 > [defaults]
7 > diff = --nodates --git
7 > diff = --nodates --git
8 > qnew = --date '0 0'
8 > qnew = --date '0 0'
9 > [shelve]
9 > [shelve]
10 > maxbackups = 2
10 > maxbackups = 2
11 > EOF
11 > EOF
12
12
13 #if phasebased
13 #if phasebased
14
14
15 $ cat <<EOF >> $HGRCPATH
15 $ cat <<EOF >> $HGRCPATH
16 > [format]
16 > [format]
17 > internal-phase = yes
17 > internal-phase = yes
18 > EOF
18 > EOF
19
19
20 #endif
20 #endif
21
21
22 $ hg init repo
22 $ hg init repo
23 $ cd repo
23 $ cd repo
24 $ mkdir a b
24 $ mkdir a b
25 $ echo a > a/a
25 $ echo a > a/a
26 $ echo b > b/b
26 $ echo b > b/b
27 $ echo c > c
27 $ echo c > c
28 $ echo d > d
28 $ echo d > d
29 $ echo x > x
29 $ echo x > x
30 $ hg addremove -q
30 $ hg addremove -q
31
31
32 shelve has a help message
32 shelve has a help message
33 $ hg shelve -h
33 $ hg shelve -h
34 hg shelve [OPTION]... [FILE]...
34 hg shelve [OPTION]... [FILE]...
35
35
36 save and set aside changes from the working directory
36 save and set aside changes from the working directory
37
37
38 Shelving takes files that "hg status" reports as not clean, saves the
38 Shelving takes files that "hg status" reports as not clean, saves the
39 modifications to a bundle (a shelved change), and reverts the files so
39 modifications to a bundle (a shelved change), and reverts the files so
40 that their state in the working directory becomes clean.
40 that their state in the working directory becomes clean.
41
41
42 To restore these changes to the working directory, using "hg unshelve";
42 To restore these changes to the working directory, using "hg unshelve";
43 this will work even if you switch to a different commit.
43 this will work even if you switch to a different commit.
44
44
45 When no files are specified, "hg shelve" saves all not-clean files. If
45 When no files are specified, "hg shelve" saves all not-clean files. If
46 specific files or directories are named, only changes to those files are
46 specific files or directories are named, only changes to those files are
47 shelved.
47 shelved.
48
48
49 In bare shelve (when no files are specified, without interactive, include
49 In bare shelve (when no files are specified, without interactive, include
50 and exclude option), shelving remembers information if the working
50 and exclude option), shelving remembers information if the working
51 directory was on newly created branch, in other words working directory
51 directory was on newly created branch, in other words working directory
52 was on different branch than its first parent. In this situation
52 was on different branch than its first parent. In this situation
53 unshelving restores branch information to the working directory.
53 unshelving restores branch information to the working directory.
54
54
55 Each shelved change has a name that makes it easier to find later. The
55 Each shelved change has a name that makes it easier to find later. The
56 name of a shelved change defaults to being based on the active bookmark,
56 name of a shelved change defaults to being based on the active bookmark,
57 or if there is no active bookmark, the current named branch. To specify a
57 or if there is no active bookmark, the current named branch. To specify a
58 different name, use "--name".
58 different name, use "--name".
59
59
60 To see a list of existing shelved changes, use the "--list" option. For
60 To see a list of existing shelved changes, use the "--list" option. For
61 each shelved change, this will print its name, age, and description; use "
61 each shelved change, this will print its name, age, and description; use "
62 --patch" or "--stat" for more details.
62 --patch" or "--stat" for more details.
63
63
64 To delete specific shelved changes, use "--delete". To delete all shelved
64 To delete specific shelved changes, use "--delete". To delete all shelved
65 changes, use "--cleanup".
65 changes, use "--cleanup".
66
66
67 options ([+] can be repeated):
67 options ([+] can be repeated):
68
68
69 -A --addremove mark new/missing files as added/removed before
69 -A --addremove mark new/missing files as added/removed before
70 shelving
70 shelving
71 -u --unknown store unknown files in the shelve
71 -u --unknown store unknown files in the shelve
72 --cleanup delete all shelved changes
72 --cleanup delete all shelved changes
73 --date DATE shelve with the specified commit date
73 --date DATE shelve with the specified commit date
74 -d --delete delete the named shelved change(s)
74 -d --delete delete the named shelved change(s)
75 -e --edit invoke editor on commit messages
75 -e --edit invoke editor on commit messages
76 -k --keep shelve, but keep changes in the working directory
76 -k --keep shelve, but keep changes in the working directory
77 -l --list list current shelves
77 -l --list list current shelves
78 -m --message TEXT use text as shelve message
78 -m --message TEXT use text as shelve message
79 -n --name NAME use the given name for the shelved commit
79 -n --name NAME use the given name for the shelved commit
80 -p --patch output patches for changes (provide the names of the
80 -p --patch output patches for changes (provide the names of the
81 shelved changes as positional arguments)
81 shelved changes as positional arguments)
82 -i --interactive interactive mode
82 -i --interactive interactive mode
83 --stat output diffstat-style summary of changes (provide
83 --stat output diffstat-style summary of changes (provide
84 the names of the shelved changes as positional
84 the names of the shelved changes as positional
85 arguments)
85 arguments)
86 -I --include PATTERN [+] include names matching the given patterns
86 -I --include PATTERN [+] include names matching the given patterns
87 -X --exclude PATTERN [+] exclude names matching the given patterns
87 -X --exclude PATTERN [+] exclude names matching the given patterns
88 --mq operate on patch repository
88 --mq operate on patch repository
89
89
90 (some details hidden, use --verbose to show complete help)
90 (some details hidden, use --verbose to show complete help)
91
91
92 shelving in an empty repo should be possible
92 shelving in an empty repo should be possible
93 (this tests also that editor is not invoked, if '--edit' is not
93 (this tests also that editor is not invoked, if '--edit' is not
94 specified)
94 specified)
95
95
96 $ HGEDITOR=cat hg shelve
96 $ HGEDITOR=cat hg shelve
97 shelved as default
97 shelved as default
98 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
98 0 files updated, 0 files merged, 5 files removed, 0 files unresolved
99
99
100 $ hg unshelve
100 $ hg unshelve
101 unshelving change 'default'
101 unshelving change 'default'
102
102
103 $ hg commit -q -m 'initial commit'
103 $ hg commit -q -m 'initial commit'
104
104
105 $ hg shelve
105 $ hg shelve
106 nothing changed
106 nothing changed
107 [1]
107 [1]
108
108
109 make sure shelve files were backed up
109 make sure shelve files were backed up
110
110
111 $ ls .hg/shelve-backup
111 $ ls .hg/shelve-backup
112 default.hg
112 default.hg
113 default.patch
113 default.patch
114 default.shelve
114 default.shelve
115
115
116 checks to make sure we dont create a directory or
116 checks to make sure we dont create a directory or
117 hidden file while choosing a new shelve name
117 hidden file while choosing a new shelve name
118
118
119 when we are given a name
119 when we are given a name
120
120
121 $ hg shelve -n foo/bar
121 $ hg shelve -n foo/bar
122 abort: shelved change names can not contain slashes
122 abort: shelved change names can not contain slashes
123 [255]
123 [255]
124 $ hg shelve -n .baz
124 $ hg shelve -n .baz
125 abort: shelved change names can not start with '.'
125 abort: shelved change names can not start with '.'
126 [255]
126 [255]
127 $ hg shelve -n foo\\bar
127 $ hg shelve -n foo\\bar
128 abort: shelved change names can not contain slashes
128 abort: shelved change names can not contain slashes
129 [255]
129 [255]
130
130
131 when shelve has to choose itself
131 when shelve has to choose itself
132
132
133 $ hg branch x/y -q
133 $ hg branch x/y -q
134 $ hg commit -q -m "Branch commit 0"
134 $ hg commit -q -m "Branch commit 0"
135 $ hg shelve
135 $ hg shelve
136 nothing changed
136 nothing changed
137 [1]
137 [1]
138 $ hg branch .x -q
138 $ hg branch .x -q
139 $ hg commit -q -m "Branch commit 1"
139 $ hg commit -q -m "Branch commit 1"
140 $ hg shelve
140 $ hg shelve
141 nothing changed
141 nothing changed
142 [1]
142 [1]
143 $ hg branch x\\y -q
143 $ hg branch x\\y -q
144 $ hg commit -q -m "Branch commit 2"
144 $ hg commit -q -m "Branch commit 2"
145 $ hg shelve
145 $ hg shelve
146 nothing changed
146 nothing changed
147 [1]
147 [1]
148
148
149 cleaning the branches made for name checking tests
149 cleaning the branches made for name checking tests
150
150
151 $ hg up default -q
151 $ hg up default -q
152 $ hg strip e9177275307e+6a6d231f43d+882bae7c62c2 -q
152 $ hg strip e9177275307e+6a6d231f43d+882bae7c62c2 -q
153
153
154 create an mq patch - shelving should work fine with a patch applied
154 create an mq patch - shelving should work fine with a patch applied
155
155
156 $ echo n > n
156 $ echo n > n
157 $ hg add n
157 $ hg add n
158 $ hg commit n -m second
158 $ hg commit n -m second
159 $ hg qnew second.patch
159 $ hg qnew second.patch
160
160
161 shelve a change that we will delete later
161 shelve a change that we will delete later
162
162
163 $ echo a >> a/a
163 $ echo a >> a/a
164 $ hg shelve
164 $ hg shelve
165 shelved as default
165 shelved as default
166 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
166 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
167
167
168 set up some more complex changes to shelve
168 set up some more complex changes to shelve
169
169
170 $ echo a >> a/a
170 $ echo a >> a/a
171 $ hg mv b b.rename
171 $ hg mv b b.rename
172 moving b/b to b.rename/b
172 moving b/b to b.rename/b
173 $ hg cp c c.copy
173 $ hg cp c c.copy
174 $ hg mv d ghost
175 $ rm ghost
174 $ hg status -C
176 $ hg status -C
175 M a/a
177 M a/a
176 A b.rename/b
178 A b.rename/b
177 b/b
179 b/b
178 A c.copy
180 A c.copy
179 c
181 c
180 R b/b
182 R b/b
183 R d
184 ! ghost
185 d
181
186
182 the common case - no options or filenames
187 the common case - no options or filenames
183
188
184 $ hg shelve
189 $ hg shelve 2>&1 | grep KeyError
185 shelved as default-01
190 KeyError: 'No such manifest entry.' (no-pure !)
186 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
191 raise KeyError (pure !)
192 KeyError (pure !)
193 # Get out of the broken state so later tests work
194 $ hg forget b.rename/b c.copy ghost
195 $ hg revert a/a b/b d
196 $ rm a/a.orig b.rename/b c.copy
187 $ hg status -C
197 $ hg status -C
188
198
189 ensure that our shelved changes exist
199 ensure that our shelved changes exist
190
200
191 $ hg shelve -l
201 $ hg shelve -l
192 default-01 (*)* changes to: [mq]: second.patch (glob)
202 default-01 (*)* changes to: [mq]: second.patch (glob)
193 default (*)* changes to: [mq]: second.patch (glob)
203 default (*)* changes to: [mq]: second.patch (glob)
194
204
195 $ hg shelve -l -p default
205 $ hg shelve -l -p default
196 default (*)* changes to: [mq]: second.patch (glob)
206 default (*)* changes to: [mq]: second.patch (glob)
197
207
198 diff --git a/a/a b/a/a
208 diff --git a/a/a b/a/a
199 --- a/a/a
209 --- a/a/a
200 +++ b/a/a
210 +++ b/a/a
201 @@ -1,1 +1,2 @@
211 @@ -1,1 +1,2 @@
202 a
212 a
203 +a
213 +a
204
214
205 $ hg shelve --list --addremove
215 $ hg shelve --list --addremove
206 abort: options '--list' and '--addremove' may not be used together
216 abort: options '--list' and '--addremove' may not be used together
207 [255]
217 [255]
208
218
209 delete our older shelved change
219 delete our older shelved change
210
220
211 $ hg shelve -d default
221 $ hg shelve -d default
212 $ hg qfinish -a -q
222 $ hg qfinish -a -q
213
223
214 ensure shelve backups aren't overwritten
224 ensure shelve backups aren't overwritten
215
225
216 $ ls .hg/shelve-backup/
226 $ ls .hg/shelve-backup/
217 default-1.hg
227 default-1.hg
218 default-1.patch
228 default-1.patch
219 default-1.shelve
229 default-1.shelve
220 default.hg
230 default.hg
221 default.patch
231 default.patch
222 default.shelve
232 default.shelve
223
233
224 local edits should not prevent a shelved change from applying
234 local edits should not prevent a shelved change from applying
225
235
226 $ printf "z\na\n" > a/a
236 $ printf "z\na\n" > a/a
227 $ hg unshelve --keep
237 $ hg unshelve --keep
228 unshelving change 'default-01'
238 unshelving change 'default-01'
229 temporarily committing pending changes (restore with 'hg unshelve --abort')
239 temporarily committing pending changes (restore with 'hg unshelve --abort')
230 rebasing shelved changes
240 rebasing shelved changes
231 merging a/a
241 merging a/a
232
242
233 $ hg revert --all -q
243 $ hg revert --all -q
234 $ rm a/a.orig b.rename/b c.copy
244 $ rm a/a.orig b.rename/b c.copy
235
245
236 apply it and make sure our state is as expected
246 apply it and make sure our state is as expected
237
247
238 (this also tests that same timestamp prevents backups from being
248 (this also tests that same timestamp prevents backups from being
239 removed, even though there are more than 'maxbackups' backups)
249 removed, even though there are more than 'maxbackups' backups)
240
250
241 $ f -t .hg/shelve-backup/default.patch
251 $ f -t .hg/shelve-backup/default.patch
242 .hg/shelve-backup/default.patch: file
252 .hg/shelve-backup/default.patch: file
243 $ touch -t 200001010000 .hg/shelve-backup/default.patch
253 $ touch -t 200001010000 .hg/shelve-backup/default.patch
244 $ f -t .hg/shelve-backup/default-1.patch
254 $ f -t .hg/shelve-backup/default-1.patch
245 .hg/shelve-backup/default-1.patch: file
255 .hg/shelve-backup/default-1.patch: file
246 $ touch -t 200001010000 .hg/shelve-backup/default-1.patch
256 $ touch -t 200001010000 .hg/shelve-backup/default-1.patch
247
257
248 $ hg unshelve
258 $ hg unshelve
249 unshelving change 'default-01'
259 unshelving change 'default-01'
250 $ hg status -C
260 $ hg status -C
251 M a/a
261 M a/a
252 A b.rename/b
262 A b.rename/b
253 b/b
263 b/b
254 A c.copy
264 A c.copy
255 c
265 c
256 R b/b
266 R b/b
267 R d
257 $ hg shelve -l
268 $ hg shelve -l
258
269
259 (both of default.hg and default-1.hg should be still kept, because it
270 (both of default.hg and default-1.hg should be still kept, because it
260 is difficult to decide actual order of them from same timestamp)
271 is difficult to decide actual order of them from same timestamp)
261
272
262 $ ls .hg/shelve-backup/
273 $ ls .hg/shelve-backup/
263 default-01.hg
274 default-01.hg
264 default-01.patch
275 default-01.patch
265 default-01.shelve
276 default-01.shelve
266 default-1.hg
277 default-1.hg
267 default-1.patch
278 default-1.patch
268 default-1.shelve
279 default-1.shelve
269 default.hg
280 default.hg
270 default.patch
281 default.patch
271 default.shelve
282 default.shelve
272
283
273 $ hg unshelve
284 $ hg unshelve
274 abort: no shelved changes to apply!
285 abort: no shelved changes to apply!
275 [255]
286 [255]
276 $ hg unshelve foo
287 $ hg unshelve foo
277 abort: shelved change 'foo' not found
288 abort: shelved change 'foo' not found
278 [255]
289 [255]
279
290
280 named shelves, specific filenames, and "commit messages" should all work
291 named shelves, specific filenames, and "commit messages" should all work
281 (this tests also that editor is invoked, if '--edit' is specified)
292 (this tests also that editor is invoked, if '--edit' is specified)
282
293
283 $ hg status -C
294 $ hg status -C
284 M a/a
295 M a/a
285 A b.rename/b
296 A b.rename/b
286 b/b
297 b/b
287 A c.copy
298 A c.copy
288 c
299 c
289 R b/b
300 R b/b
301 R d
290 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
302 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
291 wat
303 wat
292
304
293
305
294 HG: Enter commit message. Lines beginning with 'HG:' are removed.
306 HG: Enter commit message. Lines beginning with 'HG:' are removed.
295 HG: Leave message empty to abort commit.
307 HG: Leave message empty to abort commit.
296 HG: --
308 HG: --
297 HG: user: shelve@localhost
309 HG: user: shelve@localhost
298 HG: branch 'default'
310 HG: branch 'default'
299 HG: changed a/a
311 HG: changed a/a
300
312
301 expect "a" to no longer be present, but status otherwise unchanged
313 expect "a" to no longer be present, but status otherwise unchanged
302
314
303 $ hg status -C
315 $ hg status -C
304 A b.rename/b
316 A b.rename/b
305 b/b
317 b/b
306 A c.copy
318 A c.copy
307 c
319 c
308 R b/b
320 R b/b
321 R d
309 $ hg shelve -l --stat
322 $ hg shelve -l --stat
310 wibble (*) wat (glob)
323 wibble (*) wat (glob)
311 a/a | 1 +
324 a/a | 1 +
312 1 files changed, 1 insertions(+), 0 deletions(-)
325 1 files changed, 1 insertions(+), 0 deletions(-)
313
326
314 and now "a/a" should reappear
327 and now "a/a" should reappear
315
328
316 $ cd a
329 $ cd a
317 $ hg unshelve -q wibble
330 $ hg unshelve -q wibble
318 $ cd ..
331 $ cd ..
319 $ hg status -C
332 $ hg status -C
320 M a/a
333 M a/a
321 A b.rename/b
334 A b.rename/b
322 b/b
335 b/b
323 A c.copy
336 A c.copy
324 c
337 c
325 R b/b
338 R b/b
339 R d
326
340
327 ensure old shelve backups are being deleted automatically
341 ensure old shelve backups are being deleted automatically
328
342
329 $ ls .hg/shelve-backup/
343 $ ls .hg/shelve-backup/
330 default-01.hg
344 default-01.hg
331 default-01.patch
345 default-01.patch
332 default-01.shelve
346 default-01.shelve
333 wibble.hg
347 wibble.hg
334 wibble.patch
348 wibble.patch
335 wibble.shelve
349 wibble.shelve
336
350
337 cause unshelving to result in a merge with 'a' conflicting
351 cause unshelving to result in a merge with 'a' conflicting
338
352
339 $ hg shelve -q
353 $ hg shelve -q
340 $ echo c>>a/a
354 $ echo c>>a/a
341 $ hg commit -m second
355 $ hg commit -m second
342 $ hg tip --template '{files}\n'
356 $ hg tip --template '{files}\n'
343 a/a
357 a/a
344
358
345 add an unrelated change that should be preserved
359 add an unrelated change that should be preserved
346
360
347 $ mkdir foo
361 $ mkdir foo
348 $ echo foo > foo/foo
362 $ echo foo > foo/foo
349 $ hg add foo/foo
363 $ hg add foo/foo
350
364
351 force a conflicted merge to occur
365 force a conflicted merge to occur
352
366
353 $ hg unshelve
367 $ hg unshelve
354 unshelving change 'default'
368 unshelving change 'default'
355 temporarily committing pending changes (restore with 'hg unshelve --abort')
369 temporarily committing pending changes (restore with 'hg unshelve --abort')
356 rebasing shelved changes
370 rebasing shelved changes
357 merging a/a
371 merging a/a
358 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
372 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
359 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
373 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
360 [1]
374 [1]
361 $ hg status -v
375 $ hg status -v
362 M a/a
376 M a/a
363 M b.rename/b
377 M b.rename/b
364 M c.copy
378 M c.copy
365 R b/b
379 R b/b
380 R d
366 ? a/a.orig
381 ? a/a.orig
367 # The repository is in an unfinished *unshelve* state.
382 # The repository is in an unfinished *unshelve* state.
368
383
369 # Unresolved merge conflicts:
384 # Unresolved merge conflicts:
370 #
385 #
371 # a/a
386 # a/a
372 #
387 #
373 # To mark files as resolved: hg resolve --mark FILE
388 # To mark files as resolved: hg resolve --mark FILE
374
389
375 # To continue: hg unshelve --continue
390 # To continue: hg unshelve --continue
376 # To abort: hg unshelve --abort
391 # To abort: hg unshelve --abort
377
392
378
393
379 ensure that we have a merge with unresolved conflicts
394 ensure that we have a merge with unresolved conflicts
380
395
381 #if phasebased
396 #if phasebased
382 $ hg heads -q --template '{rev}\n'
397 $ hg heads -q --template '{rev}\n'
383 8
398 8
384 5
399 6
385 $ hg parents -q --template '{rev}\n'
400 $ hg parents -q --template '{rev}\n'
386 8
401 8
387 5
402 6
388 #endif
403 #endif
389
404
390 #if stripbased
405 #if stripbased
391 $ hg heads -q --template '{rev}\n'
406 $ hg heads -q --template '{rev}\n'
392 5
407 5
393 4
408 4
394 $ hg parents -q --template '{rev}\n'
409 $ hg parents -q --template '{rev}\n'
395 4
410 4
396 5
411 5
397 #endif
412 #endif
398
413
399 $ hg status
414 $ hg status
400 M a/a
415 M a/a
401 M b.rename/b
416 M b.rename/b
402 M c.copy
417 M c.copy
403 R b/b
418 R b/b
419 R d
404 ? a/a.orig
420 ? a/a.orig
405 $ hg diff
421 $ hg diff
406 diff --git a/a/a b/a/a
422 diff --git a/a/a b/a/a
407 --- a/a/a
423 --- a/a/a
408 +++ b/a/a
424 +++ b/a/a
409 @@ -1,2 +1,6 @@
425 @@ -1,2 +1,6 @@
410 a
426 a
411 +<<<<<<< shelve: 2377350b6337 - shelve: pending changes temporary commit
427 +<<<<<<< shelve: 2377350b6337 - shelve: pending changes temporary commit
412 c
428 c
413 +=======
429 +=======
414 +a
430 +a
415 +>>>>>>> working-copy: a68ec3400638 - shelve: changes to: [mq]: second.patch
431 +>>>>>>> working-copy: 203c9f771d2b - shelve: changes to: [mq]: second.patch
416 diff --git a/b/b b/b.rename/b
432 diff --git a/b/b b/b.rename/b
417 rename from b/b
433 rename from b/b
418 rename to b.rename/b
434 rename to b.rename/b
419 diff --git a/c b/c.copy
435 diff --git a/c b/c.copy
420 copy from c
436 copy from c
421 copy to c.copy
437 copy to c.copy
438 diff --git a/d b/d
439 deleted file mode 100644
440 --- a/d
441 +++ /dev/null
442 @@ -1,1 +0,0 @@
443 -d
422 $ hg resolve -l
444 $ hg resolve -l
423 U a/a
445 U a/a
424
446
425 $ hg shelve
447 $ hg shelve
426 abort: unshelve already in progress
448 abort: unshelve already in progress
427 (use 'hg unshelve --continue' or 'hg unshelve --abort')
449 (use 'hg unshelve --continue' or 'hg unshelve --abort')
428 [255]
450 [255]
429
451
430 abort the unshelve and be happy
452 abort the unshelve and be happy
431
453
432 $ hg status
454 $ hg status
433 M a/a
455 M a/a
434 M b.rename/b
456 M b.rename/b
435 M c.copy
457 M c.copy
436 R b/b
458 R b/b
459 R d
437 ? a/a.orig
460 ? a/a.orig
438 $ hg unshelve -a
461 $ hg unshelve -a
439 unshelve of 'default' aborted
462 unshelve of 'default' aborted
440 $ hg heads -q
463 $ hg heads -q
441 [37]:2e69b451d1ea (re)
464 [37]:2e69b451d1ea (re)
442 $ hg parents
465 $ hg parents
443 changeset: [37]:2e69b451d1ea (re)
466 changeset: [37]:2e69b451d1ea (re)
444 tag: tip
467 tag: tip
445 parent: 3:509104101065 (?)
468 parent: 3:509104101065 (?)
446 user: test
469 user: test
447 date: Thu Jan 01 00:00:00 1970 +0000
470 date: Thu Jan 01 00:00:00 1970 +0000
448 summary: second
471 summary: second
449
472
450 $ hg resolve -l
473 $ hg resolve -l
451 $ hg status
474 $ hg status
452 A foo/foo
475 A foo/foo
453 ? a/a.orig
476 ? a/a.orig
454
477
455 try to continue with no unshelve underway
478 try to continue with no unshelve underway
456
479
457 $ hg unshelve -c
480 $ hg unshelve -c
458 abort: no unshelve in progress
481 abort: no unshelve in progress
459 [255]
482 [255]
460 $ hg status
483 $ hg status
461 A foo/foo
484 A foo/foo
462 ? a/a.orig
485 ? a/a.orig
463
486
464 redo the unshelve to get a conflict
487 redo the unshelve to get a conflict
465
488
466 $ hg unshelve -q
489 $ hg unshelve -q
467 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
490 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
468 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
491 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
469 [1]
492 [1]
470
493
471 attempt to continue
494 attempt to continue
472
495
473 $ hg unshelve -c
496 $ hg unshelve -c
474 abort: unresolved conflicts, can't continue
497 abort: unresolved conflicts, can't continue
475 (see 'hg resolve', then 'hg unshelve --continue')
498 (see 'hg resolve', then 'hg unshelve --continue')
476 [255]
499 [255]
477
500
478 $ hg revert -r . a/a
501 $ hg revert -r . a/a
479 $ hg resolve -m a/a
502 $ hg resolve -m a/a
480 (no more unresolved files)
503 (no more unresolved files)
481 continue: hg unshelve --continue
504 continue: hg unshelve --continue
482
505
483 $ hg commit -m 'commit while unshelve in progress'
506 $ hg commit -m 'commit while unshelve in progress'
484 abort: unshelve already in progress
507 abort: unshelve already in progress
485 (use 'hg unshelve --continue' or 'hg unshelve --abort')
508 (use 'hg unshelve --continue' or 'hg unshelve --abort')
486 [255]
509 [255]
487
510
488 $ hg graft --continue
511 $ hg graft --continue
489 abort: no graft in progress
512 abort: no graft in progress
490 (continue: hg unshelve --continue)
513 (continue: hg unshelve --continue)
491 [255]
514 [255]
492 $ hg unshelve -c
515 $ hg unshelve -c
493 unshelve of 'default' complete
516 unshelve of 'default' complete
494
517
495 ensure the repo is as we hope
518 ensure the repo is as we hope
496
519
497 $ hg parents
520 $ hg parents
498 changeset: [37]:2e69b451d1ea (re)
521 changeset: [37]:2e69b451d1ea (re)
499 tag: tip
522 tag: tip
500 parent: 3:509104101065 (?)
523 parent: 3:509104101065 (?)
501 user: test
524 user: test
502 date: Thu Jan 01 00:00:00 1970 +0000
525 date: Thu Jan 01 00:00:00 1970 +0000
503 summary: second
526 summary: second
504
527
505 $ hg heads -q
528 $ hg heads -q
506 [37]:2e69b451d1ea (re)
529 [37]:2e69b451d1ea (re)
507
530
508 $ hg status -C
531 $ hg status -C
509 A b.rename/b
532 A b.rename/b
510 b/b
533 b/b
511 A c.copy
534 A c.copy
512 c
535 c
513 A foo/foo
536 A foo/foo
514 R b/b
537 R b/b
538 R d
515 ? a/a.orig
539 ? a/a.orig
516
540
517 there should be no shelves left
541 there should be no shelves left
518
542
519 $ hg shelve -l
543 $ hg shelve -l
520
544
521 #if execbit
545 #if execbit
522
546
523 ensure that metadata-only changes are shelved
547 ensure that metadata-only changes are shelved
524
548
525 $ chmod +x a/a
549 $ chmod +x a/a
526 $ hg shelve -q -n execbit a/a
550 $ hg shelve -q -n execbit a/a
527 $ hg status a/a
551 $ hg status a/a
528 $ hg unshelve -q execbit
552 $ hg unshelve -q execbit
529 $ hg status a/a
553 $ hg status a/a
530 M a/a
554 M a/a
531 $ hg revert a/a
555 $ hg revert a/a
532
556
533 #else
557 #else
534
558
535 Dummy shelve op, to keep rev numbers aligned
559 Dummy shelve op, to keep rev numbers aligned
536
560
537 $ echo foo > a/a
561 $ echo foo > a/a
538 $ hg shelve -q -n dummy a/a
562 $ hg shelve -q -n dummy a/a
539 $ hg unshelve -q dummy
563 $ hg unshelve -q dummy
540 $ hg revert a/a
564 $ hg revert a/a
541
565
542 #endif
566 #endif
543
567
544 #if symlink
568 #if symlink
545
569
546 $ rm a/a
570 $ rm a/a
547 $ ln -s foo a/a
571 $ ln -s foo a/a
548 $ hg shelve -q -n symlink a/a
572 $ hg shelve -q -n symlink a/a
549 $ hg status a/a
573 $ hg status a/a
550 $ hg unshelve -q -n symlink
574 $ hg unshelve -q -n symlink
551 $ hg status a/a
575 $ hg status a/a
552 M a/a
576 M a/a
553 $ hg revert a/a
577 $ hg revert a/a
554
578
555 #else
579 #else
556
580
557 Dummy shelve op, to keep rev numbers aligned
581 Dummy shelve op, to keep rev numbers aligned
558
582
559 $ echo bar > a/a
583 $ echo bar > a/a
560 $ hg shelve -q -n dummy a/a
584 $ hg shelve -q -n dummy a/a
561 $ hg unshelve -q dummy
585 $ hg unshelve -q dummy
562 $ hg revert a/a
586 $ hg revert a/a
563
587
564 #endif
588 #endif
565
589
566 set up another conflict between a commit and a shelved change
590 set up another conflict between a commit and a shelved change
567
591
568 $ hg revert -q -C -a
592 $ hg revert -q -C -a
569 $ rm a/a.orig b.rename/b c.copy
593 $ rm a/a.orig b.rename/b c.copy
570 $ echo a >> a/a
594 $ echo a >> a/a
571 $ hg shelve -q
595 $ hg shelve -q
572 $ echo x >> a/a
596 $ echo x >> a/a
573 $ hg ci -m 'create conflict'
597 $ hg ci -m 'create conflict'
574 $ hg add foo/foo
598 $ hg add foo/foo
575
599
576 if we resolve a conflict while unshelving, the unshelve should succeed
600 if we resolve a conflict while unshelving, the unshelve should succeed
577
601
578 $ hg unshelve --tool :merge-other --keep
602 $ hg unshelve --tool :merge-other --keep
579 unshelving change 'default'
603 unshelving change 'default'
580 temporarily committing pending changes (restore with 'hg unshelve --abort')
604 temporarily committing pending changes (restore with 'hg unshelve --abort')
581 rebasing shelved changes
605 rebasing shelved changes
582 merging a/a
606 merging a/a
583 $ hg parents -q
607 $ hg parents -q
584 (4|13):33f7f61e6c5e (re)
608 (4|13):33f7f61e6c5e (re)
585 $ hg shelve -l
609 $ hg shelve -l
586 default (*)* changes to: second (glob)
610 default (*)* changes to: second (glob)
587 $ hg status
611 $ hg status
588 M a/a
612 M a/a
589 A foo/foo
613 A foo/foo
590 $ cat a/a
614 $ cat a/a
591 a
615 a
592 c
616 c
593 a
617 a
594 $ cat > a/a << EOF
618 $ cat > a/a << EOF
595 > a
619 > a
596 > c
620 > c
597 > x
621 > x
598 > EOF
622 > EOF
599
623
600 $ HGMERGE=true hg unshelve
624 $ HGMERGE=true hg unshelve
601 unshelving change 'default'
625 unshelving change 'default'
602 temporarily committing pending changes (restore with 'hg unshelve --abort')
626 temporarily committing pending changes (restore with 'hg unshelve --abort')
603 rebasing shelved changes
627 rebasing shelved changes
604 merging a/a
628 merging a/a
605 note: unshelved changes already existed in the working copy
629 note: unshelved changes already existed in the working copy
606 $ hg parents -q
630 $ hg parents -q
607 (4|13):33f7f61e6c5e (re)
631 (4|13):33f7f61e6c5e (re)
608 $ hg shelve -l
632 $ hg shelve -l
609 $ hg status
633 $ hg status
610 A foo/foo
634 A foo/foo
611 $ cat a/a
635 $ cat a/a
612 a
636 a
613 c
637 c
614 x
638 x
615
639
616 test keep and cleanup
640 test keep and cleanup
617
641
618 $ hg shelve
642 $ hg shelve
619 shelved as default
643 shelved as default
620 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
644 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
621 $ hg shelve --list
645 $ hg shelve --list
622 default (*)* changes to: create conflict (glob)
646 default (*)* changes to: create conflict (glob)
623 $ hg unshelve -k
647 $ hg unshelve -k
624 unshelving change 'default'
648 unshelving change 'default'
625 $ hg shelve --list
649 $ hg shelve --list
626 default (*)* changes to: create conflict (glob)
650 default (*)* changes to: create conflict (glob)
627 $ hg shelve --cleanup
651 $ hg shelve --cleanup
628 $ hg shelve --list
652 $ hg shelve --list
629
653
630 $ hg shelve --cleanup --delete
654 $ hg shelve --cleanup --delete
631 abort: options '--cleanup' and '--delete' may not be used together
655 abort: options '--cleanup' and '--delete' may not be used together
632 [255]
656 [255]
633 $ hg shelve --cleanup --patch
657 $ hg shelve --cleanup --patch
634 abort: options '--cleanup' and '--patch' may not be used together
658 abort: options '--cleanup' and '--patch' may not be used together
635 [255]
659 [255]
636 $ hg shelve --cleanup --message MESSAGE
660 $ hg shelve --cleanup --message MESSAGE
637 abort: options '--cleanup' and '--message' may not be used together
661 abort: options '--cleanup' and '--message' may not be used together
638 [255]
662 [255]
639
663
640 test bookmarks
664 test bookmarks
641
665
642 $ hg bookmark test
666 $ hg bookmark test
643 $ hg bookmark
667 $ hg bookmark
644 \* test (4|13):33f7f61e6c5e (re)
668 \* test (4|13):33f7f61e6c5e (re)
645 $ hg shelve
669 $ hg shelve
646 shelved as test
670 shelved as test
647 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
671 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
648 $ hg bookmark
672 $ hg bookmark
649 \* test (4|13):33f7f61e6c5e (re)
673 \* test (4|13):33f7f61e6c5e (re)
650 $ hg unshelve
674 $ hg unshelve
651 unshelving change 'test'
675 unshelving change 'test'
652 $ hg bookmark
676 $ hg bookmark
653 \* test (4|13):33f7f61e6c5e (re)
677 \* test (4|13):33f7f61e6c5e (re)
654
678
655 shelve should still work even if mq is disabled
679 shelve should still work even if mq is disabled
656
680
657 $ hg --config extensions.mq=! shelve
681 $ hg --config extensions.mq=! shelve
658 shelved as test
682 shelved as test
659 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
683 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
660 $ hg --config extensions.mq=! shelve --list
684 $ hg --config extensions.mq=! shelve --list
661 test (*)* changes to: create conflict (glob)
685 test (*)* changes to: create conflict (glob)
662 $ hg bookmark
686 $ hg bookmark
663 \* test (4|13):33f7f61e6c5e (re)
687 \* test (4|13):33f7f61e6c5e (re)
664 $ hg --config extensions.mq=! unshelve
688 $ hg --config extensions.mq=! unshelve
665 unshelving change 'test'
689 unshelving change 'test'
666 $ hg bookmark
690 $ hg bookmark
667 \* test (4|13):33f7f61e6c5e (re)
691 \* test (4|13):33f7f61e6c5e (re)
668
692
669 Recreate some conflict again
693 Recreate some conflict again
670
694
671 $ hg up -C -r 2e69b451d1ea
695 $ hg up -C -r 2e69b451d1ea
672 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
696 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
673 (leaving bookmark test)
697 (leaving bookmark test)
674 $ echo y >> a/a
698 $ echo y >> a/a
675 $ hg shelve
699 $ hg shelve
676 shelved as default
700 shelved as default
677 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
678 $ hg up test
702 $ hg up test
679 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
703 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
680 (activating bookmark test)
704 (activating bookmark test)
681 $ hg bookmark
705 $ hg bookmark
682 \* test (4|13):33f7f61e6c5e (re)
706 \* test (4|13):33f7f61e6c5e (re)
683 $ hg unshelve
707 $ hg unshelve
684 unshelving change 'default'
708 unshelving change 'default'
685 rebasing shelved changes
709 rebasing shelved changes
686 merging a/a
710 merging a/a
687 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
711 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
688 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
712 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
689 [1]
713 [1]
690 $ hg bookmark
714 $ hg bookmark
691 test (4|13):33f7f61e6c5e (re)
715 test (4|13):33f7f61e6c5e (re)
692
716
693 Test that resolving all conflicts in one direction (so that the rebase
717 Test that resolving all conflicts in one direction (so that the rebase
694 is a no-op), works (issue4398)
718 is a no-op), works (issue4398)
695
719
696 $ hg revert -a -r .
720 $ hg revert -a -r .
697 reverting a/a
721 reverting a/a
698 $ hg resolve -m a/a
722 $ hg resolve -m a/a
699 (no more unresolved files)
723 (no more unresolved files)
700 continue: hg unshelve --continue
724 continue: hg unshelve --continue
701 $ hg unshelve -c
725 $ hg unshelve -c
702 note: unshelved changes already existed in the working copy
726 note: unshelved changes already existed in the working copy
703 unshelve of 'default' complete
727 unshelve of 'default' complete
704 $ hg bookmark
728 $ hg bookmark
705 \* test (4|13):33f7f61e6c5e (re)
729 \* test (4|13):33f7f61e6c5e (re)
706 $ hg diff
730 $ hg diff
707 $ hg status
731 $ hg status
708 ? a/a.orig
732 ? a/a.orig
709 ? foo/foo
733 ? foo/foo
710 $ hg summary
734 $ hg summary
711 parent: (4|13):33f7f61e6c5e tip (re)
735 parent: (4|13):33f7f61e6c5e tip (re)
712 create conflict
736 create conflict
713 branch: default
737 branch: default
714 bookmarks: *test
738 bookmarks: *test
715 commit: 2 unknown (clean)
739 commit: 2 unknown (clean)
716 update: (current)
740 update: (current)
717 phases: 5 draft
741 phases: 5 draft
718
742
719 $ hg shelve --delete --stat
743 $ hg shelve --delete --stat
720 abort: options '--delete' and '--stat' may not be used together
744 abort: options '--delete' and '--stat' may not be used together
721 [255]
745 [255]
722 $ hg shelve --delete --name NAME
746 $ hg shelve --delete --name NAME
723 abort: options '--delete' and '--name' may not be used together
747 abort: options '--delete' and '--name' may not be used together
724 [255]
748 [255]
725
749
726 Test interactive shelve
750 Test interactive shelve
727 $ cat <<EOF >> $HGRCPATH
751 $ cat <<EOF >> $HGRCPATH
728 > [ui]
752 > [ui]
729 > interactive = true
753 > interactive = true
730 > EOF
754 > EOF
731 $ echo 'a' >> a/b
755 $ echo 'a' >> a/b
732 $ cat a/a >> a/b
756 $ cat a/a >> a/b
733 $ echo 'x' >> a/b
757 $ echo 'x' >> a/b
734 $ mv a/b a/a
758 $ mv a/b a/a
735 $ echo 'a' >> foo/foo
759 $ echo 'a' >> foo/foo
736 $ hg st
760 $ hg st
737 M a/a
761 M a/a
738 ? a/a.orig
762 ? a/a.orig
739 ? foo/foo
763 ? foo/foo
740 $ cat a/a
764 $ cat a/a
741 a
765 a
742 a
766 a
743 c
767 c
744 x
768 x
745 x
769 x
746 $ cat foo/foo
770 $ cat foo/foo
747 foo
771 foo
748 a
772 a
749 $ hg shelve --interactive --config ui.interactive=false
773 $ hg shelve --interactive --config ui.interactive=false
750 abort: running non-interactively
774 abort: running non-interactively
751 [255]
775 [255]
752 $ hg shelve --interactive << EOF
776 $ hg shelve --interactive << EOF
753 > y
777 > y
754 > y
778 > y
755 > n
779 > n
756 > EOF
780 > EOF
757 diff --git a/a/a b/a/a
781 diff --git a/a/a b/a/a
758 2 hunks, 2 lines changed
782 2 hunks, 2 lines changed
759 examine changes to 'a/a'?
783 examine changes to 'a/a'?
760 (enter ? for help) [Ynesfdaq?] y
784 (enter ? for help) [Ynesfdaq?] y
761
785
762 @@ -1,3 +1,4 @@
786 @@ -1,3 +1,4 @@
763 +a
787 +a
764 a
788 a
765 c
789 c
766 x
790 x
767 record change 1/2 to 'a/a'?
791 record change 1/2 to 'a/a'?
768 (enter ? for help) [Ynesfdaq?] y
792 (enter ? for help) [Ynesfdaq?] y
769
793
770 @@ -1,3 +2,4 @@
794 @@ -1,3 +2,4 @@
771 a
795 a
772 c
796 c
773 x
797 x
774 +x
798 +x
775 record change 2/2 to 'a/a'?
799 record change 2/2 to 'a/a'?
776 (enter ? for help) [Ynesfdaq?] n
800 (enter ? for help) [Ynesfdaq?] n
777
801
778 shelved as test
802 shelved as test
779 merging a/a
803 merging a/a
780 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
804 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
781 $ cat a/a
805 $ cat a/a
782 a
806 a
783 c
807 c
784 x
808 x
785 x
809 x
786 $ cat foo/foo
810 $ cat foo/foo
787 foo
811 foo
788 a
812 a
789 $ hg st
813 $ hg st
790 M a/a
814 M a/a
791 ? foo/foo
815 ? foo/foo
792 $ hg bookmark
816 $ hg bookmark
793 \* test (4|13):33f7f61e6c5e (re)
817 \* test (4|13):33f7f61e6c5e (re)
794 $ hg unshelve
818 $ hg unshelve
795 unshelving change 'test'
819 unshelving change 'test'
796 temporarily committing pending changes (restore with 'hg unshelve --abort')
820 temporarily committing pending changes (restore with 'hg unshelve --abort')
797 rebasing shelved changes
821 rebasing shelved changes
798 merging a/a
822 merging a/a
799 $ hg bookmark
823 $ hg bookmark
800 \* test (4|13):33f7f61e6c5e (re)
824 \* test (4|13):33f7f61e6c5e (re)
801 $ cat a/a
825 $ cat a/a
802 a
826 a
803 a
827 a
804 c
828 c
805 x
829 x
806 x
830 x
807
831
808 shelve --patch and shelve --stat should work with valid shelfnames
832 shelve --patch and shelve --stat should work with valid shelfnames
809
833
810 $ hg up --clean .
834 $ hg up --clean .
811 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
835 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
812 (leaving bookmark test)
836 (leaving bookmark test)
813 $ hg shelve --list
837 $ hg shelve --list
814 $ echo 'patch a' > shelf-patch-a
838 $ echo 'patch a' > shelf-patch-a
815 $ hg add shelf-patch-a
839 $ hg add shelf-patch-a
816 $ hg shelve
840 $ hg shelve
817 shelved as default
841 shelved as default
818 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
842 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
819 $ echo 'patch b' > shelf-patch-b
843 $ echo 'patch b' > shelf-patch-b
820 $ hg add shelf-patch-b
844 $ hg add shelf-patch-b
821 $ hg shelve
845 $ hg shelve
822 shelved as default-01
846 shelved as default-01
823 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
847 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
824 $ hg shelve --patch default default-01
848 $ hg shelve --patch default default-01
825 default-01 (*)* changes to: create conflict (glob)
849 default-01 (*)* changes to: create conflict (glob)
826
850
827 diff --git a/shelf-patch-b b/shelf-patch-b
851 diff --git a/shelf-patch-b b/shelf-patch-b
828 new file mode 100644
852 new file mode 100644
829 --- /dev/null
853 --- /dev/null
830 +++ b/shelf-patch-b
854 +++ b/shelf-patch-b
831 @@ -0,0 +1,1 @@
855 @@ -0,0 +1,1 @@
832 +patch b
856 +patch b
833 default (*)* changes to: create conflict (glob)
857 default (*)* changes to: create conflict (glob)
834
858
835 diff --git a/shelf-patch-a b/shelf-patch-a
859 diff --git a/shelf-patch-a b/shelf-patch-a
836 new file mode 100644
860 new file mode 100644
837 --- /dev/null
861 --- /dev/null
838 +++ b/shelf-patch-a
862 +++ b/shelf-patch-a
839 @@ -0,0 +1,1 @@
863 @@ -0,0 +1,1 @@
840 +patch a
864 +patch a
841 $ hg shelve --stat default default-01
865 $ hg shelve --stat default default-01
842 default-01 (*)* changes to: create conflict (glob)
866 default-01 (*)* changes to: create conflict (glob)
843 shelf-patch-b | 1 +
867 shelf-patch-b | 1 +
844 1 files changed, 1 insertions(+), 0 deletions(-)
868 1 files changed, 1 insertions(+), 0 deletions(-)
845 default (*)* changes to: create conflict (glob)
869 default (*)* changes to: create conflict (glob)
846 shelf-patch-a | 1 +
870 shelf-patch-a | 1 +
847 1 files changed, 1 insertions(+), 0 deletions(-)
871 1 files changed, 1 insertions(+), 0 deletions(-)
848 $ hg shelve --patch default
872 $ hg shelve --patch default
849 default (*)* changes to: create conflict (glob)
873 default (*)* changes to: create conflict (glob)
850
874
851 diff --git a/shelf-patch-a b/shelf-patch-a
875 diff --git a/shelf-patch-a b/shelf-patch-a
852 new file mode 100644
876 new file mode 100644
853 --- /dev/null
877 --- /dev/null
854 +++ b/shelf-patch-a
878 +++ b/shelf-patch-a
855 @@ -0,0 +1,1 @@
879 @@ -0,0 +1,1 @@
856 +patch a
880 +patch a
857 $ hg shelve --stat default
881 $ hg shelve --stat default
858 default (*)* changes to: create conflict (glob)
882 default (*)* changes to: create conflict (glob)
859 shelf-patch-a | 1 +
883 shelf-patch-a | 1 +
860 1 files changed, 1 insertions(+), 0 deletions(-)
884 1 files changed, 1 insertions(+), 0 deletions(-)
861 $ hg shelve --patch nonexistentshelf
885 $ hg shelve --patch nonexistentshelf
862 abort: cannot find shelf nonexistentshelf
886 abort: cannot find shelf nonexistentshelf
863 [255]
887 [255]
864 $ hg shelve --stat nonexistentshelf
888 $ hg shelve --stat nonexistentshelf
865 abort: cannot find shelf nonexistentshelf
889 abort: cannot find shelf nonexistentshelf
866 [255]
890 [255]
867 $ hg shelve --patch default nonexistentshelf
891 $ hg shelve --patch default nonexistentshelf
868 abort: cannot find shelf nonexistentshelf
892 abort: cannot find shelf nonexistentshelf
869 [255]
893 [255]
870
894
871 when the user asks for a patch, we assume they want the most recent shelve if
895 when the user asks for a patch, we assume they want the most recent shelve if
872 they don't provide a shelve name
896 they don't provide a shelve name
873
897
874 $ hg shelve --patch
898 $ hg shelve --patch
875 default-01 (*)* changes to: create conflict (glob)
899 default-01 (*)* changes to: create conflict (glob)
876
900
877 diff --git a/shelf-patch-b b/shelf-patch-b
901 diff --git a/shelf-patch-b b/shelf-patch-b
878 new file mode 100644
902 new file mode 100644
879 --- /dev/null
903 --- /dev/null
880 +++ b/shelf-patch-b
904 +++ b/shelf-patch-b
881 @@ -0,0 +1,1 @@
905 @@ -0,0 +1,1 @@
882 +patch b
906 +patch b
883
907
884 $ cd ..
908 $ cd ..
885
909
886 Shelve from general delta repo uses bundle2 on disk
910 Shelve from general delta repo uses bundle2 on disk
887 --------------------------------------------------
911 --------------------------------------------------
888
912
889 no general delta
913 no general delta
890
914
891 $ hg clone --pull repo bundle1 --config format.usegeneraldelta=0
915 $ hg clone --pull repo bundle1 --config format.usegeneraldelta=0
892 requesting all changes
916 requesting all changes
893 adding changesets
917 adding changesets
894 adding manifests
918 adding manifests
895 adding file changes
919 adding file changes
896 added 5 changesets with 8 changes to 6 files
920 added 5 changesets with 8 changes to 6 files
897 new changesets cc01e2b0c59f:33f7f61e6c5e
921 new changesets cc01e2b0c59f:33f7f61e6c5e
898 updating to branch default
922 updating to branch default
899 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
923 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
900 $ cd bundle1
924 $ cd bundle1
901 $ echo babar > jungle
925 $ echo babar > jungle
902 $ hg add jungle
926 $ hg add jungle
903 $ hg shelve
927 $ hg shelve
904 shelved as default
928 shelved as default
905 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
929 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
906 $ hg debugbundle .hg/shelved/*.hg
930 $ hg debugbundle .hg/shelved/*.hg
907 330882a04d2ce8487636b1fb292e5beea77fa1e3
931 330882a04d2ce8487636b1fb292e5beea77fa1e3
908 $ cd ..
932 $ cd ..
909
933
910 with general delta
934 with general delta
911
935
912 $ hg clone --pull repo bundle2 --config format.usegeneraldelta=1
936 $ hg clone --pull repo bundle2 --config format.usegeneraldelta=1
913 requesting all changes
937 requesting all changes
914 adding changesets
938 adding changesets
915 adding manifests
939 adding manifests
916 adding file changes
940 adding file changes
917 added 5 changesets with 8 changes to 6 files
941 added 5 changesets with 8 changes to 6 files
918 new changesets cc01e2b0c59f:33f7f61e6c5e
942 new changesets cc01e2b0c59f:33f7f61e6c5e
919 updating to branch default
943 updating to branch default
920 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
944 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
921 $ cd bundle2
945 $ cd bundle2
922 $ echo babar > jungle
946 $ echo babar > jungle
923 $ hg add jungle
947 $ hg add jungle
924 $ hg shelve
948 $ hg shelve
925 shelved as default
949 shelved as default
926 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
950 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
927 $ hg debugbundle .hg/shelved/*.hg
951 $ hg debugbundle .hg/shelved/*.hg
928 Stream params: {Compression: BZ}
952 Stream params: {Compression: BZ}
929 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
953 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
930 330882a04d2ce8487636b1fb292e5beea77fa1e3
954 330882a04d2ce8487636b1fb292e5beea77fa1e3
931
955
932 Test shelve --keep
956 Test shelve --keep
933
957
934 $ hg unshelve
958 $ hg unshelve
935 unshelving change 'default'
959 unshelving change 'default'
936 $ hg shelve --keep --list
960 $ hg shelve --keep --list
937 abort: options '--list' and '--keep' may not be used together
961 abort: options '--list' and '--keep' may not be used together
938 [255]
962 [255]
939 $ hg shelve --keep --patch
963 $ hg shelve --keep --patch
940 abort: options '--patch' and '--keep' may not be used together
964 abort: options '--patch' and '--keep' may not be used together
941 [255]
965 [255]
942 $ hg shelve --keep --delete
966 $ hg shelve --keep --delete
943 abort: options '--delete' and '--keep' may not be used together
967 abort: options '--delete' and '--keep' may not be used together
944 [255]
968 [255]
945 $ hg shelve --keep
969 $ hg shelve --keep
946 shelved as default
970 shelved as default
947 $ hg diff
971 $ hg diff
948 diff --git a/jungle b/jungle
972 diff --git a/jungle b/jungle
949 new file mode 100644
973 new file mode 100644
950 --- /dev/null
974 --- /dev/null
951 +++ b/jungle
975 +++ b/jungle
952 @@ -0,0 +1,1 @@
976 @@ -0,0 +1,1 @@
953 +babar
977 +babar
954
978
955 Test shelve --delete
979 Test shelve --delete
956
980
957 $ hg shelve --list
981 $ hg shelve --list
958 default (*s ago) changes to: create conflict (glob)
982 default (*s ago) changes to: create conflict (glob)
959 $ hg shelve --delete doesnotexist
983 $ hg shelve --delete doesnotexist
960 abort: shelved change 'doesnotexist' not found
984 abort: shelved change 'doesnotexist' not found
961 [255]
985 [255]
962 $ hg shelve --delete default
986 $ hg shelve --delete default
963
987
964 $ cd ..
988 $ cd ..
965
989
966 Test visibility of in-memory changes inside transaction to external hook
990 Test visibility of in-memory changes inside transaction to external hook
967 ------------------------------------------------------------------------
991 ------------------------------------------------------------------------
968
992
969 $ cd repo
993 $ cd repo
970
994
971 $ echo xxxx >> x
995 $ echo xxxx >> x
972 $ hg commit -m "#5: changes to invoke rebase"
996 $ hg commit -m "#5: changes to invoke rebase"
973
997
974 $ cat > $TESTTMP/checkvisibility.sh <<EOF
998 $ cat > $TESTTMP/checkvisibility.sh <<EOF
975 > echo "==== \$1:"
999 > echo "==== \$1:"
976 > hg parents --template "VISIBLE {rev}:{node|short}\n"
1000 > hg parents --template "VISIBLE {rev}:{node|short}\n"
977 > # test that pending changes are hidden
1001 > # test that pending changes are hidden
978 > unset HG_PENDING
1002 > unset HG_PENDING
979 > hg parents --template "ACTUAL {rev}:{node|short}\n"
1003 > hg parents --template "ACTUAL {rev}:{node|short}\n"
980 > echo "===="
1004 > echo "===="
981 > EOF
1005 > EOF
982
1006
983 $ cat >> .hg/hgrc <<EOF
1007 $ cat >> .hg/hgrc <<EOF
984 > [defaults]
1008 > [defaults]
985 > # to fix hash id of temporary revisions
1009 > # to fix hash id of temporary revisions
986 > unshelve = --date '0 0'
1010 > unshelve = --date '0 0'
987 > EOF
1011 > EOF
988
1012
989 "hg unshelve" at REV5 implies steps below:
1013 "hg unshelve" at REV5 implies steps below:
990
1014
991 (1) commit changes in the working directory (REV6)
1015 (1) commit changes in the working directory (REV6)
992 (2) unbundle shelved revision (REV7)
1016 (2) unbundle shelved revision (REV7)
993 (3) rebase: merge REV7 into REV6 (REV6 => REV6, REV7)
1017 (3) rebase: merge REV7 into REV6 (REV6 => REV6, REV7)
994 (4) rebase: commit merged revision (REV8)
1018 (4) rebase: commit merged revision (REV8)
995 (5) rebase: update to REV6 (REV8 => REV6)
1019 (5) rebase: update to REV6 (REV8 => REV6)
996 (6) update to REV5 (REV6 => REV5)
1020 (6) update to REV5 (REV6 => REV5)
997 (7) abort transaction
1021 (7) abort transaction
998
1022
999 == test visibility to external preupdate hook
1023 == test visibility to external preupdate hook
1000
1024
1001 $ cat >> .hg/hgrc <<EOF
1025 $ cat >> .hg/hgrc <<EOF
1002 > [hooks]
1026 > [hooks]
1003 > preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate
1027 > preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate
1004 > EOF
1028 > EOF
1005
1029
1006 $ echo nnnn >> n
1030 $ echo nnnn >> n
1007
1031
1008 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1032 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1009 ==== before-unshelving:
1033 ==== before-unshelving:
1010 VISIBLE (5|19):703117a2acfb (re)
1034 VISIBLE (5|19):703117a2acfb (re)
1011 ACTUAL (5|19):703117a2acfb (re)
1035 ACTUAL (5|19):703117a2acfb (re)
1012 ====
1036 ====
1013
1037
1014 $ hg unshelve --keep default
1038 $ hg unshelve --keep default
1015 temporarily committing pending changes (restore with 'hg unshelve --abort')
1039 temporarily committing pending changes (restore with 'hg unshelve --abort')
1016 rebasing shelved changes
1040 rebasing shelved changes
1017 ==== preupdate:
1041 ==== preupdate:
1018 VISIBLE (6|20):54c00d20fb3f (re)
1042 VISIBLE (6|20):54c00d20fb3f (re)
1019 ACTUAL (5|19):703117a2acfb (re)
1043 ACTUAL (5|19):703117a2acfb (re)
1020 ====
1044 ====
1021 ==== preupdate:
1045 ==== preupdate:
1022 VISIBLE (8|21):8efe6f7537dc (re)
1046 VISIBLE (8|21):8efe6f7537dc (re)
1023 ACTUAL (5|19):703117a2acfb (re)
1047 ACTUAL (5|19):703117a2acfb (re)
1024 ====
1048 ====
1025 ==== preupdate:
1049 ==== preupdate:
1026 VISIBLE (6|20):54c00d20fb3f (re)
1050 VISIBLE (6|20):54c00d20fb3f (re)
1027 ACTUAL (5|19):703117a2acfb (re)
1051 ACTUAL (5|19):703117a2acfb (re)
1028 ====
1052 ====
1029
1053
1030 $ cat >> .hg/hgrc <<EOF
1054 $ cat >> .hg/hgrc <<EOF
1031 > [hooks]
1055 > [hooks]
1032 > preupdate.visibility =
1056 > preupdate.visibility =
1033 > EOF
1057 > EOF
1034
1058
1035 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1059 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1036 ==== after-unshelving:
1060 ==== after-unshelving:
1037 VISIBLE (5|19):703117a2acfb (re)
1061 VISIBLE (5|19):703117a2acfb (re)
1038 ACTUAL (5|19):703117a2acfb (re)
1062 ACTUAL (5|19):703117a2acfb (re)
1039 ====
1063 ====
1040
1064
1041 == test visibility to external update hook
1065 == test visibility to external update hook
1042
1066
1043 $ hg update -q -C 703117a2acfb
1067 $ hg update -q -C 703117a2acfb
1044
1068
1045 $ cat >> .hg/hgrc <<EOF
1069 $ cat >> .hg/hgrc <<EOF
1046 > [hooks]
1070 > [hooks]
1047 > update.visibility = sh $TESTTMP/checkvisibility.sh update
1071 > update.visibility = sh $TESTTMP/checkvisibility.sh update
1048 > EOF
1072 > EOF
1049
1073
1050 $ echo nnnn >> n
1074 $ echo nnnn >> n
1051
1075
1052 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1076 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1053 ==== before-unshelving:
1077 ==== before-unshelving:
1054 VISIBLE (5|19):703117a2acfb (re)
1078 VISIBLE (5|19):703117a2acfb (re)
1055 ACTUAL (5|19):703117a2acfb (re)
1079 ACTUAL (5|19):703117a2acfb (re)
1056 ====
1080 ====
1057
1081
1058 $ hg unshelve --keep default
1082 $ hg unshelve --keep default
1059 temporarily committing pending changes (restore with 'hg unshelve --abort')
1083 temporarily committing pending changes (restore with 'hg unshelve --abort')
1060 rebasing shelved changes
1084 rebasing shelved changes
1061 ==== update:
1085 ==== update:
1062 VISIBLE (6|20):54c00d20fb3f (re)
1086 VISIBLE (6|20):54c00d20fb3f (re)
1063 VISIBLE 1?7:492ed9d705e5 (re)
1087 VISIBLE 1?7:492ed9d705e5 (re)
1064 ACTUAL (5|19):703117a2acfb (re)
1088 ACTUAL (5|19):703117a2acfb (re)
1065 ====
1089 ====
1066 ==== update:
1090 ==== update:
1067 VISIBLE (6|20):54c00d20fb3f (re)
1091 VISIBLE (6|20):54c00d20fb3f (re)
1068 ACTUAL (5|19):703117a2acfb (re)
1092 ACTUAL (5|19):703117a2acfb (re)
1069 ====
1093 ====
1070 ==== update:
1094 ==== update:
1071 VISIBLE (5|19):703117a2acfb (re)
1095 VISIBLE (5|19):703117a2acfb (re)
1072 ACTUAL (5|19):703117a2acfb (re)
1096 ACTUAL (5|19):703117a2acfb (re)
1073 ====
1097 ====
1074
1098
1075 $ cat >> .hg/hgrc <<EOF
1099 $ cat >> .hg/hgrc <<EOF
1076 > [hooks]
1100 > [hooks]
1077 > update.visibility =
1101 > update.visibility =
1078 > EOF
1102 > EOF
1079
1103
1080 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1104 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1081 ==== after-unshelving:
1105 ==== after-unshelving:
1082 VISIBLE (5|19):703117a2acfb (re)
1106 VISIBLE (5|19):703117a2acfb (re)
1083 ACTUAL (5|19):703117a2acfb (re)
1107 ACTUAL (5|19):703117a2acfb (re)
1084 ====
1108 ====
1085
1109
1086 $ cd ..
1110 $ cd ..
1087
1111
1088 Keep active bookmark while (un)shelving even on shared repo (issue4940)
1112 Keep active bookmark while (un)shelving even on shared repo (issue4940)
1089 -----------------------------------------------------------------------
1113 -----------------------------------------------------------------------
1090
1114
1091 $ cat <<EOF >> $HGRCPATH
1115 $ cat <<EOF >> $HGRCPATH
1092 > [extensions]
1116 > [extensions]
1093 > share =
1117 > share =
1094 > EOF
1118 > EOF
1095
1119
1096 $ hg bookmarks -R repo
1120 $ hg bookmarks -R repo
1097 test (4|13):33f7f61e6c5e (re)
1121 test (4|13):33f7f61e6c5e (re)
1098 $ hg share -B repo share
1122 $ hg share -B repo share
1099 updating working directory
1123 updating working directory
1100 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1124 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1101 $ cd share
1125 $ cd share
1102
1126
1103 $ hg bookmarks
1127 $ hg bookmarks
1104 test (4|13):33f7f61e6c5e (re)
1128 test (4|13):33f7f61e6c5e (re)
1105 $ hg bookmarks foo
1129 $ hg bookmarks foo
1106 $ hg bookmarks
1130 $ hg bookmarks
1107 \* foo (5|19):703117a2acfb (re)
1131 \* foo (5|19):703117a2acfb (re)
1108 test (4|13):33f7f61e6c5e (re)
1132 test (4|13):33f7f61e6c5e (re)
1109 $ echo x >> x
1133 $ echo x >> x
1110 $ hg shelve
1134 $ hg shelve
1111 shelved as foo
1135 shelved as foo
1112 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1136 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1113 $ hg bookmarks
1137 $ hg bookmarks
1114 \* foo (5|19):703117a2acfb (re)
1138 \* foo (5|19):703117a2acfb (re)
1115 test (4|13):33f7f61e6c5e (re)
1139 test (4|13):33f7f61e6c5e (re)
1116
1140
1117 $ hg unshelve
1141 $ hg unshelve
1118 unshelving change 'foo'
1142 unshelving change 'foo'
1119 $ hg bookmarks
1143 $ hg bookmarks
1120 \* foo (5|19):703117a2acfb (re)
1144 \* foo (5|19):703117a2acfb (re)
1121 test (4|13):33f7f61e6c5e (re)
1145 test (4|13):33f7f61e6c5e (re)
1122
1146
1123 $ cd ..
1147 $ cd ..
1124
1148
1125 Abort unshelve while merging (issue5123)
1149 Abort unshelve while merging (issue5123)
1126 ----------------------------------------
1150 ----------------------------------------
1127
1151
1128 $ hg init issue5123
1152 $ hg init issue5123
1129 $ cd issue5123
1153 $ cd issue5123
1130 $ echo > a
1154 $ echo > a
1131 $ hg ci -Am a
1155 $ hg ci -Am a
1132 adding a
1156 adding a
1133 $ hg co null
1157 $ hg co null
1134 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1158 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1135 $ echo > b
1159 $ echo > b
1136 $ hg ci -Am b
1160 $ hg ci -Am b
1137 adding b
1161 adding b
1138 created new head
1162 created new head
1139 $ echo > c
1163 $ echo > c
1140 $ hg add c
1164 $ hg add c
1141 $ hg shelve
1165 $ hg shelve
1142 shelved as default
1166 shelved as default
1143 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1167 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1144 $ hg co 1
1168 $ hg co 1
1145 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1169 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1146 $ hg merge 0
1170 $ hg merge 0
1147 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1171 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1148 (branch merge, don't forget to commit)
1172 (branch merge, don't forget to commit)
1149 -- successful merge with two parents
1173 -- successful merge with two parents
1150 $ hg log -G
1174 $ hg log -G
1151 @ changeset: 1:406bf70c274f
1175 @ changeset: 1:406bf70c274f
1152 tag: tip
1176 tag: tip
1153 parent: -1:000000000000
1177 parent: -1:000000000000
1154 user: test
1178 user: test
1155 date: Thu Jan 01 00:00:00 1970 +0000
1179 date: Thu Jan 01 00:00:00 1970 +0000
1156 summary: b
1180 summary: b
1157
1181
1158 @ changeset: 0:ada8c9eb8252
1182 @ changeset: 0:ada8c9eb8252
1159 user: test
1183 user: test
1160 date: Thu Jan 01 00:00:00 1970 +0000
1184 date: Thu Jan 01 00:00:00 1970 +0000
1161 summary: a
1185 summary: a
1162
1186
1163 -- trying to pull in the shelve bits
1187 -- trying to pull in the shelve bits
1164 -- unshelve should abort otherwise, it'll eat my second parent.
1188 -- unshelve should abort otherwise, it'll eat my second parent.
1165 $ hg unshelve
1189 $ hg unshelve
1166 abort: outstanding uncommitted merge
1190 abort: outstanding uncommitted merge
1167 (use 'hg commit' or 'hg merge --abort')
1191 (use 'hg commit' or 'hg merge --abort')
1168 [255]
1192 [255]
1169
1193
1170 $ cd ..
1194 $ cd ..
1171
1195
1172 -- test for interactive mode on unshelve
1196 -- test for interactive mode on unshelve
1173
1197
1174 $ hg init a
1198 $ hg init a
1175 $ cd a
1199 $ cd a
1176 $ echo > b
1200 $ echo > b
1177 $ hg ci -Am b
1201 $ hg ci -Am b
1178 adding b
1202 adding b
1179 $ echo > c
1203 $ echo > c
1180 $ echo > d
1204 $ echo > d
1181 $ hg add .
1205 $ hg add .
1182 adding c
1206 adding c
1183 adding d
1207 adding d
1184 $ hg shelve
1208 $ hg shelve
1185 shelved as default
1209 shelved as default
1186 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1210 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1187 $ echo > e
1211 $ echo > e
1188 $ hg add e
1212 $ hg add e
1189 $ hg ci -m e
1213 $ hg ci -m e
1190 $ hg shelve --patch
1214 $ hg shelve --patch
1191 default (*s ago) changes to: b (glob)
1215 default (*s ago) changes to: b (glob)
1192
1216
1193 diff --git a/c b/c
1217 diff --git a/c b/c
1194 new file mode 100644
1218 new file mode 100644
1195 --- /dev/null
1219 --- /dev/null
1196 +++ b/c
1220 +++ b/c
1197 @@ -0,0 +1,1 @@
1221 @@ -0,0 +1,1 @@
1198 +
1222 +
1199 diff --git a/d b/d
1223 diff --git a/d b/d
1200 new file mode 100644
1224 new file mode 100644
1201 --- /dev/null
1225 --- /dev/null
1202 +++ b/d
1226 +++ b/d
1203 @@ -0,0 +1,1 @@
1227 @@ -0,0 +1,1 @@
1204 +
1228 +
1205 $ hg unshelve -i <<EOF
1229 $ hg unshelve -i <<EOF
1206 > y
1230 > y
1207 > y
1231 > y
1208 > y
1232 > y
1209 > n
1233 > n
1210 > EOF
1234 > EOF
1211 unshelving change 'default'
1235 unshelving change 'default'
1212 rebasing shelved changes
1236 rebasing shelved changes
1213 diff --git a/c b/c
1237 diff --git a/c b/c
1214 new file mode 100644
1238 new file mode 100644
1215 examine changes to 'c'?
1239 examine changes to 'c'?
1216 (enter ? for help) [Ynesfdaq?] y
1240 (enter ? for help) [Ynesfdaq?] y
1217
1241
1218 @@ -0,0 +1,1 @@
1242 @@ -0,0 +1,1 @@
1219 +
1243 +
1220 record change 1/2 to 'c'?
1244 record change 1/2 to 'c'?
1221 (enter ? for help) [Ynesfdaq?] y
1245 (enter ? for help) [Ynesfdaq?] y
1222
1246
1223 diff --git a/d b/d
1247 diff --git a/d b/d
1224 new file mode 100644
1248 new file mode 100644
1225 examine changes to 'd'?
1249 examine changes to 'd'?
1226 (enter ? for help) [Ynesfdaq?] y
1250 (enter ? for help) [Ynesfdaq?] y
1227
1251
1228 @@ -0,0 +1,1 @@
1252 @@ -0,0 +1,1 @@
1229 +
1253 +
1230 record change 2/2 to 'd'?
1254 record change 2/2 to 'd'?
1231 (enter ? for help) [Ynesfdaq?] n
1255 (enter ? for help) [Ynesfdaq?] n
1232
1256
1233 $ ls
1257 $ ls
1234 b
1258 b
1235 c
1259 c
1236 e
1260 e
1237 -- shelve should not contain `c` now
1261 -- shelve should not contain `c` now
1238 $ hg shelve --patch
1262 $ hg shelve --patch
1239 default (*s ago) changes to: b (glob)
1263 default (*s ago) changes to: b (glob)
1240
1264
1241 diff --git a/d b/d
1265 diff --git a/d b/d
1242 new file mode 100644
1266 new file mode 100644
1243 --- /dev/null
1267 --- /dev/null
1244 +++ b/d
1268 +++ b/d
1245 @@ -0,0 +1,1 @@
1269 @@ -0,0 +1,1 @@
1246 +
1270 +
1247 $ hg unshelve -i <<EOF
1271 $ hg unshelve -i <<EOF
1248 > y
1272 > y
1249 > y
1273 > y
1250 > EOF
1274 > EOF
1251 unshelving change 'default'
1275 unshelving change 'default'
1252 temporarily committing pending changes (restore with 'hg unshelve --abort')
1276 temporarily committing pending changes (restore with 'hg unshelve --abort')
1253 rebasing shelved changes
1277 rebasing shelved changes
1254 diff --git a/d b/d
1278 diff --git a/d b/d
1255 new file mode 100644
1279 new file mode 100644
1256 examine changes to 'd'?
1280 examine changes to 'd'?
1257 (enter ? for help) [Ynesfdaq?] y
1281 (enter ? for help) [Ynesfdaq?] y
1258
1282
1259 @@ -0,0 +1,1 @@
1283 @@ -0,0 +1,1 @@
1260 +
1284 +
1261 record this change to 'd'?
1285 record this change to 'd'?
1262 (enter ? for help) [Ynesfdaq?] y
1286 (enter ? for help) [Ynesfdaq?] y
1263
1287
1264
1288
1265 $ hg status -v
1289 $ hg status -v
1266 A c
1290 A c
1267 A d
1291 A d
1268 $ ls
1292 $ ls
1269 b
1293 b
1270 c
1294 c
1271 d
1295 d
1272 e
1296 e
1273 $ hg shelve --list
1297 $ hg shelve --list
1274
1298
1275 -- now, unshelve selected changes from a file
1299 -- now, unshelve selected changes from a file
1276
1300
1277 $ echo B > foo
1301 $ echo B > foo
1278 $ hg add foo
1302 $ hg add foo
1279 $ hg ci -m 'add B to foo'
1303 $ hg ci -m 'add B to foo'
1280 $ cat > foo <<EOF
1304 $ cat > foo <<EOF
1281 > A
1305 > A
1282 > B
1306 > B
1283 > C
1307 > C
1284 > EOF
1308 > EOF
1285 $ echo > garbage
1309 $ echo > garbage
1286 $ hg st
1310 $ hg st
1287 M foo
1311 M foo
1288 ? garbage
1312 ? garbage
1289 $ hg shelve --unknown
1313 $ hg shelve --unknown
1290 shelved as default
1314 shelved as default
1291 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1315 1 files updated, 0 files merged, 1 files removed, 0 files unresolved
1292 $ cat foo
1316 $ cat foo
1293 B
1317 B
1294 $ hg unshelve -i <<EOF
1318 $ hg unshelve -i <<EOF
1295 > y
1319 > y
1296 > y
1320 > y
1297 > n
1321 > n
1298 > y
1322 > y
1299 > y
1323 > y
1300 > EOF
1324 > EOF
1301 unshelving change 'default'
1325 unshelving change 'default'
1302 rebasing shelved changes
1326 rebasing shelved changes
1303 diff --git a/foo b/foo
1327 diff --git a/foo b/foo
1304 2 hunks, 2 lines changed
1328 2 hunks, 2 lines changed
1305 examine changes to 'foo'?
1329 examine changes to 'foo'?
1306 (enter ? for help) [Ynesfdaq?] y
1330 (enter ? for help) [Ynesfdaq?] y
1307
1331
1308 @@ -1,1 +1,2 @@
1332 @@ -1,1 +1,2 @@
1309 +A
1333 +A
1310 B
1334 B
1311 record change 1/3 to 'foo'?
1335 record change 1/3 to 'foo'?
1312 (enter ? for help) [Ynesfdaq?] y
1336 (enter ? for help) [Ynesfdaq?] y
1313
1337
1314 @@ -1,1 +2,2 @@
1338 @@ -1,1 +2,2 @@
1315 B
1339 B
1316 +C
1340 +C
1317 record change 2/3 to 'foo'?
1341 record change 2/3 to 'foo'?
1318 (enter ? for help) [Ynesfdaq?] n
1342 (enter ? for help) [Ynesfdaq?] n
1319
1343
1320 diff --git a/garbage b/garbage
1344 diff --git a/garbage b/garbage
1321 new file mode 100644
1345 new file mode 100644
1322 examine changes to 'garbage'?
1346 examine changes to 'garbage'?
1323 (enter ? for help) [Ynesfdaq?] y
1347 (enter ? for help) [Ynesfdaq?] y
1324
1348
1325 @@ -0,0 +1,1 @@
1349 @@ -0,0 +1,1 @@
1326 +
1350 +
1327 record change 3/3 to 'garbage'?
1351 record change 3/3 to 'garbage'?
1328 (enter ? for help) [Ynesfdaq?] y
1352 (enter ? for help) [Ynesfdaq?] y
1329
1353
1330 $ hg st
1354 $ hg st
1331 M foo
1355 M foo
1332 ? garbage
1356 ? garbage
1333 $ cat foo
1357 $ cat foo
1334 A
1358 A
1335 B
1359 B
1336 $ hg shelve --patch
1360 $ hg shelve --patch
1337 default (*s ago) changes to: add B to foo (glob)
1361 default (*s ago) changes to: add B to foo (glob)
1338
1362
1339 diff --git a/foo b/foo
1363 diff --git a/foo b/foo
1340 --- a/foo
1364 --- a/foo
1341 +++ b/foo
1365 +++ b/foo
1342 @@ -1,2 +1,3 @@
1366 @@ -1,2 +1,3 @@
1343 A
1367 A
1344 B
1368 B
1345 +C
1369 +C
1346
1370
1347 -- unshelve interactive on conflicts
1371 -- unshelve interactive on conflicts
1348
1372
1349 $ echo A >> bar1
1373 $ echo A >> bar1
1350 $ echo A >> bar2
1374 $ echo A >> bar2
1351 $ hg add bar1 bar2
1375 $ hg add bar1 bar2
1352 $ hg ci -m 'add A to bars'
1376 $ hg ci -m 'add A to bars'
1353 $ echo B >> bar1
1377 $ echo B >> bar1
1354 $ echo B >> bar2
1378 $ echo B >> bar2
1355 $ hg shelve
1379 $ hg shelve
1356 shelved as default-01
1380 shelved as default-01
1357 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1381 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1358 $ echo C >> bar1
1382 $ echo C >> bar1
1359 $ echo C >> bar2
1383 $ echo C >> bar2
1360 $ hg ci -m 'add C to bars'
1384 $ hg ci -m 'add C to bars'
1361 $ hg unshelve -i
1385 $ hg unshelve -i
1362 unshelving change 'default-01'
1386 unshelving change 'default-01'
1363 rebasing shelved changes
1387 rebasing shelved changes
1364 merging bar1
1388 merging bar1
1365 merging bar2
1389 merging bar2
1366 warning: conflicts while merging bar1! (edit, then use 'hg resolve --mark')
1390 warning: conflicts while merging bar1! (edit, then use 'hg resolve --mark')
1367 warning: conflicts while merging bar2! (edit, then use 'hg resolve --mark')
1391 warning: conflicts while merging bar2! (edit, then use 'hg resolve --mark')
1368 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
1392 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
1369 [1]
1393 [1]
1370
1394
1371 $ cat > bar1 <<EOF
1395 $ cat > bar1 <<EOF
1372 > A
1396 > A
1373 > B
1397 > B
1374 > C
1398 > C
1375 > EOF
1399 > EOF
1376 $ cat > bar2 <<EOF
1400 $ cat > bar2 <<EOF
1377 > A
1401 > A
1378 > B
1402 > B
1379 > C
1403 > C
1380 > EOF
1404 > EOF
1381 $ hg resolve -m bar1 bar2
1405 $ hg resolve -m bar1 bar2
1382 (no more unresolved files)
1406 (no more unresolved files)
1383 continue: hg unshelve --continue
1407 continue: hg unshelve --continue
1384
1408
1385 -- using --continue with --interactive should throw an error
1409 -- using --continue with --interactive should throw an error
1386 $ hg unshelve --continue -i
1410 $ hg unshelve --continue -i
1387 abort: cannot use both continue and interactive
1411 abort: cannot use both continue and interactive
1388 [255]
1412 [255]
1389
1413
1390 $ cat bar1
1414 $ cat bar1
1391 A
1415 A
1392 B
1416 B
1393 C
1417 C
1394
1418
1395 #if stripbased
1419 #if stripbased
1396 $ hg log -r 3:: -G
1420 $ hg log -r 3:: -G
1397 @ changeset: 5:f1d5f53e397b
1421 @ changeset: 5:f1d5f53e397b
1398 | tag: tip
1422 | tag: tip
1399 | parent: 3:e28fd7fa7938
1423 | parent: 3:e28fd7fa7938
1400 | user: shelve@localhost
1424 | user: shelve@localhost
1401 | date: Thu Jan 01 00:00:00 1970 +0000
1425 | date: Thu Jan 01 00:00:00 1970 +0000
1402 | summary: changes to: add A to bars
1426 | summary: changes to: add A to bars
1403 |
1427 |
1404 | @ changeset: 4:fe451a778c81
1428 | @ changeset: 4:fe451a778c81
1405 |/ user: test
1429 |/ user: test
1406 | date: Thu Jan 01 00:00:00 1970 +0000
1430 | date: Thu Jan 01 00:00:00 1970 +0000
1407 | summary: add C to bars
1431 | summary: add C to bars
1408 |
1432 |
1409 o changeset: 3:e28fd7fa7938
1433 o changeset: 3:e28fd7fa7938
1410 | user: test
1434 | user: test
1411 ~ date: Thu Jan 01 00:00:00 1970 +0000
1435 ~ date: Thu Jan 01 00:00:00 1970 +0000
1412 summary: add A to bars
1436 summary: add A to bars
1413
1437
1414 #endif
1438 #endif
1415
1439
1416 $ hg unshelve --continue <<EOF
1440 $ hg unshelve --continue <<EOF
1417 > y
1441 > y
1418 > y
1442 > y
1419 > y
1443 > y
1420 > n
1444 > n
1421 > EOF
1445 > EOF
1422 diff --git a/bar1 b/bar1
1446 diff --git a/bar1 b/bar1
1423 1 hunks, 1 lines changed
1447 1 hunks, 1 lines changed
1424 examine changes to 'bar1'?
1448 examine changes to 'bar1'?
1425 (enter ? for help) [Ynesfdaq?] y
1449 (enter ? for help) [Ynesfdaq?] y
1426
1450
1427 @@ -1,2 +1,3 @@
1451 @@ -1,2 +1,3 @@
1428 A
1452 A
1429 +B
1453 +B
1430 C
1454 C
1431 record change 1/2 to 'bar1'?
1455 record change 1/2 to 'bar1'?
1432 (enter ? for help) [Ynesfdaq?] y
1456 (enter ? for help) [Ynesfdaq?] y
1433
1457
1434 diff --git a/bar2 b/bar2
1458 diff --git a/bar2 b/bar2
1435 1 hunks, 1 lines changed
1459 1 hunks, 1 lines changed
1436 examine changes to 'bar2'?
1460 examine changes to 'bar2'?
1437 (enter ? for help) [Ynesfdaq?] y
1461 (enter ? for help) [Ynesfdaq?] y
1438
1462
1439 @@ -1,2 +1,3 @@
1463 @@ -1,2 +1,3 @@
1440 A
1464 A
1441 +B
1465 +B
1442 C
1466 C
1443 record change 2/2 to 'bar2'?
1467 record change 2/2 to 'bar2'?
1444 (enter ? for help) [Ynesfdaq?] n
1468 (enter ? for help) [Ynesfdaq?] n
1445
1469
1446 unshelve of 'default-01' complete
1470 unshelve of 'default-01' complete
1447
1471
1448 #if stripbased
1472 #if stripbased
1449 $ hg log -r 3:: -G
1473 $ hg log -r 3:: -G
1450 @ changeset: 4:fe451a778c81
1474 @ changeset: 4:fe451a778c81
1451 | tag: tip
1475 | tag: tip
1452 | user: test
1476 | user: test
1453 | date: Thu Jan 01 00:00:00 1970 +0000
1477 | date: Thu Jan 01 00:00:00 1970 +0000
1454 | summary: add C to bars
1478 | summary: add C to bars
1455 |
1479 |
1456 o changeset: 3:e28fd7fa7938
1480 o changeset: 3:e28fd7fa7938
1457 | user: test
1481 | user: test
1458 ~ date: Thu Jan 01 00:00:00 1970 +0000
1482 ~ date: Thu Jan 01 00:00:00 1970 +0000
1459 summary: add A to bars
1483 summary: add A to bars
1460
1484
1461 #endif
1485 #endif
1462
1486
1463 $ hg unshelve --continue
1487 $ hg unshelve --continue
1464 abort: no unshelve in progress
1488 abort: no unshelve in progress
1465 [255]
1489 [255]
1466
1490
1467 $ hg shelve --list
1491 $ hg shelve --list
1468 default-01 (*)* changes to: add A to bars (glob)
1492 default-01 (*)* changes to: add A to bars (glob)
1469 default (*)* changes to: add B to foo (glob)
1493 default (*)* changes to: add B to foo (glob)
1470 $ hg unshelve -n default-01 -i <<EOF
1494 $ hg unshelve -n default-01 -i <<EOF
1471 > y
1495 > y
1472 > y
1496 > y
1473 > EOF
1497 > EOF
1474 temporarily committing pending changes (restore with 'hg unshelve --abort')
1498 temporarily committing pending changes (restore with 'hg unshelve --abort')
1475 rebasing shelved changes
1499 rebasing shelved changes
1476 diff --git a/bar2 b/bar2
1500 diff --git a/bar2 b/bar2
1477 1 hunks, 1 lines changed
1501 1 hunks, 1 lines changed
1478 examine changes to 'bar2'?
1502 examine changes to 'bar2'?
1479 (enter ? for help) [Ynesfdaq?] y
1503 (enter ? for help) [Ynesfdaq?] y
1480
1504
1481 @@ -1,2 +1,3 @@
1505 @@ -1,2 +1,3 @@
1482 A
1506 A
1483 +B
1507 +B
1484 C
1508 C
1485 record this change to 'bar2'?
1509 record this change to 'bar2'?
1486 (enter ? for help) [Ynesfdaq?] y
1510 (enter ? for help) [Ynesfdaq?] y
1487
1511
1488 -- test for --interactive --keep
1512 -- test for --interactive --keep
1489 $ hg unshelve -i --keep
1513 $ hg unshelve -i --keep
1490 abort: --keep on --interactive is not yet supported
1514 abort: --keep on --interactive is not yet supported
1491 [255]
1515 [255]
General Comments 0
You need to be logged in to leave comments. Login now