##// END OF EJS Templates
tests: glob over some timing numbers in test-shelve.t...
Matt Harbison -
r42848:94460411 default
parent child Browse files
Show More
@@ -1,1385 +1,1385
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 status -C
174 $ hg status -C
175 M a/a
175 M a/a
176 A b.rename/b
176 A b.rename/b
177 b/b
177 b/b
178 A c.copy
178 A c.copy
179 c
179 c
180 R b/b
180 R b/b
181
181
182 the common case - no options or filenames
182 the common case - no options or filenames
183
183
184 $ hg shelve
184 $ hg shelve
185 shelved as default-01
185 shelved as default-01
186 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
186 2 files updated, 0 files merged, 2 files removed, 0 files unresolved
187 $ hg status -C
187 $ hg status -C
188
188
189 ensure that our shelved changes exist
189 ensure that our shelved changes exist
190
190
191 $ hg shelve -l
191 $ hg shelve -l
192 default-01 (*)* changes to: [mq]: second.patch (glob)
192 default-01 (*)* changes to: [mq]: second.patch (glob)
193 default (*)* changes to: [mq]: second.patch (glob)
193 default (*)* changes to: [mq]: second.patch (glob)
194
194
195 $ hg shelve -l -p default
195 $ hg shelve -l -p default
196 default (*)* changes to: [mq]: second.patch (glob)
196 default (*)* changes to: [mq]: second.patch (glob)
197
197
198 diff --git a/a/a b/a/a
198 diff --git a/a/a b/a/a
199 --- a/a/a
199 --- a/a/a
200 +++ b/a/a
200 +++ b/a/a
201 @@ -1,1 +1,2 @@
201 @@ -1,1 +1,2 @@
202 a
202 a
203 +a
203 +a
204
204
205 $ hg shelve --list --addremove
205 $ hg shelve --list --addremove
206 abort: options '--list' and '--addremove' may not be used together
206 abort: options '--list' and '--addremove' may not be used together
207 [255]
207 [255]
208
208
209 delete our older shelved change
209 delete our older shelved change
210
210
211 $ hg shelve -d default
211 $ hg shelve -d default
212 $ hg qfinish -a -q
212 $ hg qfinish -a -q
213
213
214 ensure shelve backups aren't overwritten
214 ensure shelve backups aren't overwritten
215
215
216 $ ls .hg/shelve-backup/
216 $ ls .hg/shelve-backup/
217 default-1.hg
217 default-1.hg
218 default-1.patch
218 default-1.patch
219 default-1.shelve
219 default-1.shelve
220 default.hg
220 default.hg
221 default.patch
221 default.patch
222 default.shelve
222 default.shelve
223
223
224 local edits should not prevent a shelved change from applying
224 local edits should not prevent a shelved change from applying
225
225
226 $ printf "z\na\n" > a/a
226 $ printf "z\na\n" > a/a
227 $ hg unshelve --keep
227 $ hg unshelve --keep
228 unshelving change 'default-01'
228 unshelving change 'default-01'
229 temporarily committing pending changes (restore with 'hg unshelve --abort')
229 temporarily committing pending changes (restore with 'hg unshelve --abort')
230 rebasing shelved changes
230 rebasing shelved changes
231 merging a/a
231 merging a/a
232
232
233 $ hg revert --all -q
233 $ hg revert --all -q
234 $ rm a/a.orig b.rename/b c.copy
234 $ rm a/a.orig b.rename/b c.copy
235
235
236 apply it and make sure our state is as expected
236 apply it and make sure our state is as expected
237
237
238 (this also tests that same timestamp prevents backups from being
238 (this also tests that same timestamp prevents backups from being
239 removed, even though there are more than 'maxbackups' backups)
239 removed, even though there are more than 'maxbackups' backups)
240
240
241 $ f -t .hg/shelve-backup/default.patch
241 $ f -t .hg/shelve-backup/default.patch
242 .hg/shelve-backup/default.patch: file
242 .hg/shelve-backup/default.patch: file
243 $ touch -t 200001010000 .hg/shelve-backup/default.patch
243 $ touch -t 200001010000 .hg/shelve-backup/default.patch
244 $ f -t .hg/shelve-backup/default-1.patch
244 $ f -t .hg/shelve-backup/default-1.patch
245 .hg/shelve-backup/default-1.patch: file
245 .hg/shelve-backup/default-1.patch: file
246 $ touch -t 200001010000 .hg/shelve-backup/default-1.patch
246 $ touch -t 200001010000 .hg/shelve-backup/default-1.patch
247
247
248 $ hg unshelve
248 $ hg unshelve
249 unshelving change 'default-01'
249 unshelving change 'default-01'
250 $ hg status -C
250 $ hg status -C
251 M a/a
251 M a/a
252 A b.rename/b
252 A b.rename/b
253 b/b
253 b/b
254 A c.copy
254 A c.copy
255 c
255 c
256 R b/b
256 R b/b
257 $ hg shelve -l
257 $ hg shelve -l
258
258
259 (both of default.hg and default-1.hg should be still kept, because it
259 (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)
260 is difficult to decide actual order of them from same timestamp)
261
261
262 $ ls .hg/shelve-backup/
262 $ ls .hg/shelve-backup/
263 default-01.hg
263 default-01.hg
264 default-01.patch
264 default-01.patch
265 default-01.shelve
265 default-01.shelve
266 default-1.hg
266 default-1.hg
267 default-1.patch
267 default-1.patch
268 default-1.shelve
268 default-1.shelve
269 default.hg
269 default.hg
270 default.patch
270 default.patch
271 default.shelve
271 default.shelve
272
272
273 $ hg unshelve
273 $ hg unshelve
274 abort: no shelved changes to apply!
274 abort: no shelved changes to apply!
275 [255]
275 [255]
276 $ hg unshelve foo
276 $ hg unshelve foo
277 abort: shelved change 'foo' not found
277 abort: shelved change 'foo' not found
278 [255]
278 [255]
279
279
280 named shelves, specific filenames, and "commit messages" should all work
280 named shelves, specific filenames, and "commit messages" should all work
281 (this tests also that editor is invoked, if '--edit' is specified)
281 (this tests also that editor is invoked, if '--edit' is specified)
282
282
283 $ hg status -C
283 $ hg status -C
284 M a/a
284 M a/a
285 A b.rename/b
285 A b.rename/b
286 b/b
286 b/b
287 A c.copy
287 A c.copy
288 c
288 c
289 R b/b
289 R b/b
290 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
290 $ HGEDITOR=cat hg shelve -q -n wibble -m wat -e a
291 wat
291 wat
292
292
293
293
294 HG: Enter commit message. Lines beginning with 'HG:' are removed.
294 HG: Enter commit message. Lines beginning with 'HG:' are removed.
295 HG: Leave message empty to abort commit.
295 HG: Leave message empty to abort commit.
296 HG: --
296 HG: --
297 HG: user: shelve@localhost
297 HG: user: shelve@localhost
298 HG: branch 'default'
298 HG: branch 'default'
299 HG: changed a/a
299 HG: changed a/a
300
300
301 expect "a" to no longer be present, but status otherwise unchanged
301 expect "a" to no longer be present, but status otherwise unchanged
302
302
303 $ hg status -C
303 $ hg status -C
304 A b.rename/b
304 A b.rename/b
305 b/b
305 b/b
306 A c.copy
306 A c.copy
307 c
307 c
308 R b/b
308 R b/b
309 $ hg shelve -l --stat
309 $ hg shelve -l --stat
310 wibble (*) wat (glob)
310 wibble (*) wat (glob)
311 a/a | 1 +
311 a/a | 1 +
312 1 files changed, 1 insertions(+), 0 deletions(-)
312 1 files changed, 1 insertions(+), 0 deletions(-)
313
313
314 and now "a/a" should reappear
314 and now "a/a" should reappear
315
315
316 $ cd a
316 $ cd a
317 $ hg unshelve -q wibble
317 $ hg unshelve -q wibble
318 $ cd ..
318 $ cd ..
319 $ hg status -C
319 $ hg status -C
320 M a/a
320 M a/a
321 A b.rename/b
321 A b.rename/b
322 b/b
322 b/b
323 A c.copy
323 A c.copy
324 c
324 c
325 R b/b
325 R b/b
326
326
327 ensure old shelve backups are being deleted automatically
327 ensure old shelve backups are being deleted automatically
328
328
329 $ ls .hg/shelve-backup/
329 $ ls .hg/shelve-backup/
330 default-01.hg
330 default-01.hg
331 default-01.patch
331 default-01.patch
332 default-01.shelve
332 default-01.shelve
333 wibble.hg
333 wibble.hg
334 wibble.patch
334 wibble.patch
335 wibble.shelve
335 wibble.shelve
336
336
337 cause unshelving to result in a merge with 'a' conflicting
337 cause unshelving to result in a merge with 'a' conflicting
338
338
339 $ hg shelve -q
339 $ hg shelve -q
340 $ echo c>>a/a
340 $ echo c>>a/a
341 $ hg commit -m second
341 $ hg commit -m second
342 $ hg tip --template '{files}\n'
342 $ hg tip --template '{files}\n'
343 a/a
343 a/a
344
344
345 add an unrelated change that should be preserved
345 add an unrelated change that should be preserved
346
346
347 $ mkdir foo
347 $ mkdir foo
348 $ echo foo > foo/foo
348 $ echo foo > foo/foo
349 $ hg add foo/foo
349 $ hg add foo/foo
350
350
351 force a conflicted merge to occur
351 force a conflicted merge to occur
352
352
353 $ hg unshelve
353 $ hg unshelve
354 unshelving change 'default'
354 unshelving change 'default'
355 temporarily committing pending changes (restore with 'hg unshelve --abort')
355 temporarily committing pending changes (restore with 'hg unshelve --abort')
356 rebasing shelved changes
356 rebasing shelved changes
357 merging a/a
357 merging a/a
358 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
358 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
359 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
359 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
360 [1]
360 [1]
361 $ hg status -v
361 $ hg status -v
362 M a/a
362 M a/a
363 M b.rename/b
363 M b.rename/b
364 M c.copy
364 M c.copy
365 R b/b
365 R b/b
366 ? a/a.orig
366 ? a/a.orig
367 # The repository is in an unfinished *unshelve* state.
367 # The repository is in an unfinished *unshelve* state.
368
368
369 # Unresolved merge conflicts:
369 # Unresolved merge conflicts:
370 #
370 #
371 # a/a
371 # a/a
372 #
372 #
373 # To mark files as resolved: hg resolve --mark FILE
373 # To mark files as resolved: hg resolve --mark FILE
374
374
375 # To continue: hg unshelve --continue
375 # To continue: hg unshelve --continue
376 # To abort: hg unshelve --abort
376 # To abort: hg unshelve --abort
377
377
378
378
379 ensure that we have a merge with unresolved conflicts
379 ensure that we have a merge with unresolved conflicts
380
380
381 #if phasebased
381 #if phasebased
382 $ hg heads -q --template '{rev}\n'
382 $ hg heads -q --template '{rev}\n'
383 8
383 8
384 5
384 5
385 $ hg parents -q --template '{rev}\n'
385 $ hg parents -q --template '{rev}\n'
386 8
386 8
387 5
387 5
388 #endif
388 #endif
389
389
390 #if stripbased
390 #if stripbased
391 $ hg heads -q --template '{rev}\n'
391 $ hg heads -q --template '{rev}\n'
392 5
392 5
393 4
393 4
394 $ hg parents -q --template '{rev}\n'
394 $ hg parents -q --template '{rev}\n'
395 4
395 4
396 5
396 5
397 #endif
397 #endif
398
398
399 $ hg status
399 $ hg status
400 M a/a
400 M a/a
401 M b.rename/b
401 M b.rename/b
402 M c.copy
402 M c.copy
403 R b/b
403 R b/b
404 ? a/a.orig
404 ? a/a.orig
405 $ hg diff
405 $ hg diff
406 diff --git a/a/a b/a/a
406 diff --git a/a/a b/a/a
407 --- a/a/a
407 --- a/a/a
408 +++ b/a/a
408 +++ b/a/a
409 @@ -1,2 +1,6 @@
409 @@ -1,2 +1,6 @@
410 a
410 a
411 +<<<<<<< shelve: 2377350b6337 - shelve: pending changes temporary commit
411 +<<<<<<< shelve: 2377350b6337 - shelve: pending changes temporary commit
412 c
412 c
413 +=======
413 +=======
414 +a
414 +a
415 +>>>>>>> working-copy: a68ec3400638 - shelve: changes to: [mq]: second.patch
415 +>>>>>>> working-copy: a68ec3400638 - shelve: changes to: [mq]: second.patch
416 diff --git a/b/b b/b.rename/b
416 diff --git a/b/b b/b.rename/b
417 rename from b/b
417 rename from b/b
418 rename to b.rename/b
418 rename to b.rename/b
419 diff --git a/c b/c.copy
419 diff --git a/c b/c.copy
420 copy from c
420 copy from c
421 copy to c.copy
421 copy to c.copy
422 $ hg resolve -l
422 $ hg resolve -l
423 U a/a
423 U a/a
424
424
425 $ hg shelve
425 $ hg shelve
426 abort: unshelve already in progress
426 abort: unshelve already in progress
427 (use 'hg unshelve --continue' or 'hg unshelve --abort')
427 (use 'hg unshelve --continue' or 'hg unshelve --abort')
428 [255]
428 [255]
429
429
430 abort the unshelve and be happy
430 abort the unshelve and be happy
431
431
432 $ hg status
432 $ hg status
433 M a/a
433 M a/a
434 M b.rename/b
434 M b.rename/b
435 M c.copy
435 M c.copy
436 R b/b
436 R b/b
437 ? a/a.orig
437 ? a/a.orig
438 $ hg unshelve -a
438 $ hg unshelve -a
439 unshelve of 'default' aborted
439 unshelve of 'default' aborted
440 $ hg heads -q
440 $ hg heads -q
441 [37]:2e69b451d1ea (re)
441 [37]:2e69b451d1ea (re)
442 $ hg parents
442 $ hg parents
443 changeset: [37]:2e69b451d1ea (re)
443 changeset: [37]:2e69b451d1ea (re)
444 tag: tip
444 tag: tip
445 parent: 3:509104101065 (?)
445 parent: 3:509104101065 (?)
446 user: test
446 user: test
447 date: Thu Jan 01 00:00:00 1970 +0000
447 date: Thu Jan 01 00:00:00 1970 +0000
448 summary: second
448 summary: second
449
449
450 $ hg resolve -l
450 $ hg resolve -l
451 $ hg status
451 $ hg status
452 A foo/foo
452 A foo/foo
453 ? a/a.orig
453 ? a/a.orig
454
454
455 try to continue with no unshelve underway
455 try to continue with no unshelve underway
456
456
457 $ hg unshelve -c
457 $ hg unshelve -c
458 abort: no unshelve in progress
458 abort: no unshelve in progress
459 [255]
459 [255]
460 $ hg status
460 $ hg status
461 A foo/foo
461 A foo/foo
462 ? a/a.orig
462 ? a/a.orig
463
463
464 redo the unshelve to get a conflict
464 redo the unshelve to get a conflict
465
465
466 $ hg unshelve -q
466 $ hg unshelve -q
467 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
467 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
468 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
468 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
469 [1]
469 [1]
470
470
471 attempt to continue
471 attempt to continue
472
472
473 $ hg unshelve -c
473 $ hg unshelve -c
474 abort: unresolved conflicts, can't continue
474 abort: unresolved conflicts, can't continue
475 (see 'hg resolve', then 'hg unshelve --continue')
475 (see 'hg resolve', then 'hg unshelve --continue')
476 [255]
476 [255]
477
477
478 $ hg revert -r . a/a
478 $ hg revert -r . a/a
479 $ hg resolve -m a/a
479 $ hg resolve -m a/a
480 (no more unresolved files)
480 (no more unresolved files)
481 continue: hg unshelve --continue
481 continue: hg unshelve --continue
482
482
483 $ hg commit -m 'commit while unshelve in progress'
483 $ hg commit -m 'commit while unshelve in progress'
484 abort: unshelve already in progress
484 abort: unshelve already in progress
485 (use 'hg unshelve --continue' or 'hg unshelve --abort')
485 (use 'hg unshelve --continue' or 'hg unshelve --abort')
486 [255]
486 [255]
487
487
488 $ hg graft --continue
488 $ hg graft --continue
489 abort: no graft in progress
489 abort: no graft in progress
490 (continue: hg unshelve --continue)
490 (continue: hg unshelve --continue)
491 [255]
491 [255]
492 $ hg unshelve -c
492 $ hg unshelve -c
493 unshelve of 'default' complete
493 unshelve of 'default' complete
494
494
495 ensure the repo is as we hope
495 ensure the repo is as we hope
496
496
497 $ hg parents
497 $ hg parents
498 changeset: [37]:2e69b451d1ea (re)
498 changeset: [37]:2e69b451d1ea (re)
499 tag: tip
499 tag: tip
500 parent: 3:509104101065 (?)
500 parent: 3:509104101065 (?)
501 user: test
501 user: test
502 date: Thu Jan 01 00:00:00 1970 +0000
502 date: Thu Jan 01 00:00:00 1970 +0000
503 summary: second
503 summary: second
504
504
505 $ hg heads -q
505 $ hg heads -q
506 [37]:2e69b451d1ea (re)
506 [37]:2e69b451d1ea (re)
507
507
508 $ hg status -C
508 $ hg status -C
509 A b.rename/b
509 A b.rename/b
510 b/b
510 b/b
511 A c.copy
511 A c.copy
512 c
512 c
513 A foo/foo
513 A foo/foo
514 R b/b
514 R b/b
515 ? a/a.orig
515 ? a/a.orig
516
516
517 there should be no shelves left
517 there should be no shelves left
518
518
519 $ hg shelve -l
519 $ hg shelve -l
520
520
521 #if execbit
521 #if execbit
522
522
523 ensure that metadata-only changes are shelved
523 ensure that metadata-only changes are shelved
524
524
525 $ chmod +x a/a
525 $ chmod +x a/a
526 $ hg shelve -q -n execbit a/a
526 $ hg shelve -q -n execbit a/a
527 $ hg status a/a
527 $ hg status a/a
528 $ hg unshelve -q execbit
528 $ hg unshelve -q execbit
529 $ hg status a/a
529 $ hg status a/a
530 M a/a
530 M a/a
531 $ hg revert a/a
531 $ hg revert a/a
532
532
533 #else
533 #else
534
534
535 Dummy shelve op, to keep rev numbers aligned
535 Dummy shelve op, to keep rev numbers aligned
536
536
537 $ echo foo > a/a
537 $ echo foo > a/a
538 $ hg shelve -q -n dummy a/a
538 $ hg shelve -q -n dummy a/a
539 $ hg unshelve -q dummy
539 $ hg unshelve -q dummy
540 $ hg revert a/a
540 $ hg revert a/a
541
541
542 #endif
542 #endif
543
543
544 #if symlink
544 #if symlink
545
545
546 $ rm a/a
546 $ rm a/a
547 $ ln -s foo a/a
547 $ ln -s foo a/a
548 $ hg shelve -q -n symlink a/a
548 $ hg shelve -q -n symlink a/a
549 $ hg status a/a
549 $ hg status a/a
550 $ hg unshelve -q -n symlink
550 $ hg unshelve -q -n symlink
551 $ hg status a/a
551 $ hg status a/a
552 M a/a
552 M a/a
553 $ hg revert a/a
553 $ hg revert a/a
554
554
555 #else
555 #else
556
556
557 Dummy shelve op, to keep rev numbers aligned
557 Dummy shelve op, to keep rev numbers aligned
558
558
559 $ echo bar > a/a
559 $ echo bar > a/a
560 $ hg shelve -q -n dummy a/a
560 $ hg shelve -q -n dummy a/a
561 $ hg unshelve -q dummy
561 $ hg unshelve -q dummy
562 $ hg revert a/a
562 $ hg revert a/a
563
563
564 #endif
564 #endif
565
565
566 set up another conflict between a commit and a shelved change
566 set up another conflict between a commit and a shelved change
567
567
568 $ hg revert -q -C -a
568 $ hg revert -q -C -a
569 $ rm a/a.orig b.rename/b c.copy
569 $ rm a/a.orig b.rename/b c.copy
570 $ echo a >> a/a
570 $ echo a >> a/a
571 $ hg shelve -q
571 $ hg shelve -q
572 $ echo x >> a/a
572 $ echo x >> a/a
573 $ hg ci -m 'create conflict'
573 $ hg ci -m 'create conflict'
574 $ hg add foo/foo
574 $ hg add foo/foo
575
575
576 if we resolve a conflict while unshelving, the unshelve should succeed
576 if we resolve a conflict while unshelving, the unshelve should succeed
577
577
578 $ hg unshelve --tool :merge-other --keep
578 $ hg unshelve --tool :merge-other --keep
579 unshelving change 'default'
579 unshelving change 'default'
580 temporarily committing pending changes (restore with 'hg unshelve --abort')
580 temporarily committing pending changes (restore with 'hg unshelve --abort')
581 rebasing shelved changes
581 rebasing shelved changes
582 merging a/a
582 merging a/a
583 $ hg parents -q
583 $ hg parents -q
584 (4|13):33f7f61e6c5e (re)
584 (4|13):33f7f61e6c5e (re)
585 $ hg shelve -l
585 $ hg shelve -l
586 default (*)* changes to: second (glob)
586 default (*)* changes to: second (glob)
587 $ hg status
587 $ hg status
588 M a/a
588 M a/a
589 A foo/foo
589 A foo/foo
590 $ cat a/a
590 $ cat a/a
591 a
591 a
592 c
592 c
593 a
593 a
594 $ cat > a/a << EOF
594 $ cat > a/a << EOF
595 > a
595 > a
596 > c
596 > c
597 > x
597 > x
598 > EOF
598 > EOF
599
599
600 $ HGMERGE=true hg unshelve
600 $ HGMERGE=true hg unshelve
601 unshelving change 'default'
601 unshelving change 'default'
602 temporarily committing pending changes (restore with 'hg unshelve --abort')
602 temporarily committing pending changes (restore with 'hg unshelve --abort')
603 rebasing shelved changes
603 rebasing shelved changes
604 merging a/a
604 merging a/a
605 note: unshelved changes already existed in the working copy
605 note: unshelved changes already existed in the working copy
606 $ hg parents -q
606 $ hg parents -q
607 (4|13):33f7f61e6c5e (re)
607 (4|13):33f7f61e6c5e (re)
608 $ hg shelve -l
608 $ hg shelve -l
609 $ hg status
609 $ hg status
610 A foo/foo
610 A foo/foo
611 $ cat a/a
611 $ cat a/a
612 a
612 a
613 c
613 c
614 x
614 x
615
615
616 test keep and cleanup
616 test keep and cleanup
617
617
618 $ hg shelve
618 $ hg shelve
619 shelved as default
619 shelved as default
620 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
620 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
621 $ hg shelve --list
621 $ hg shelve --list
622 default (*)* changes to: create conflict (glob)
622 default (*)* changes to: create conflict (glob)
623 $ hg unshelve -k
623 $ hg unshelve -k
624 unshelving change 'default'
624 unshelving change 'default'
625 $ hg shelve --list
625 $ hg shelve --list
626 default (*)* changes to: create conflict (glob)
626 default (*)* changes to: create conflict (glob)
627 $ hg shelve --cleanup
627 $ hg shelve --cleanup
628 $ hg shelve --list
628 $ hg shelve --list
629
629
630 $ hg shelve --cleanup --delete
630 $ hg shelve --cleanup --delete
631 abort: options '--cleanup' and '--delete' may not be used together
631 abort: options '--cleanup' and '--delete' may not be used together
632 [255]
632 [255]
633 $ hg shelve --cleanup --patch
633 $ hg shelve --cleanup --patch
634 abort: options '--cleanup' and '--patch' may not be used together
634 abort: options '--cleanup' and '--patch' may not be used together
635 [255]
635 [255]
636 $ hg shelve --cleanup --message MESSAGE
636 $ hg shelve --cleanup --message MESSAGE
637 abort: options '--cleanup' and '--message' may not be used together
637 abort: options '--cleanup' and '--message' may not be used together
638 [255]
638 [255]
639
639
640 test bookmarks
640 test bookmarks
641
641
642 $ hg bookmark test
642 $ hg bookmark test
643 $ hg bookmark
643 $ hg bookmark
644 \* test (4|13):33f7f61e6c5e (re)
644 \* test (4|13):33f7f61e6c5e (re)
645 $ hg shelve
645 $ hg shelve
646 shelved as test
646 shelved as test
647 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
647 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
648 $ hg bookmark
648 $ hg bookmark
649 \* test (4|13):33f7f61e6c5e (re)
649 \* test (4|13):33f7f61e6c5e (re)
650 $ hg unshelve
650 $ hg unshelve
651 unshelving change 'test'
651 unshelving change 'test'
652 $ hg bookmark
652 $ hg bookmark
653 \* test (4|13):33f7f61e6c5e (re)
653 \* test (4|13):33f7f61e6c5e (re)
654
654
655 shelve should still work even if mq is disabled
655 shelve should still work even if mq is disabled
656
656
657 $ hg --config extensions.mq=! shelve
657 $ hg --config extensions.mq=! shelve
658 shelved as test
658 shelved as test
659 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
659 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
660 $ hg --config extensions.mq=! shelve --list
660 $ hg --config extensions.mq=! shelve --list
661 test (*)* changes to: create conflict (glob)
661 test (*)* changes to: create conflict (glob)
662 $ hg bookmark
662 $ hg bookmark
663 \* test (4|13):33f7f61e6c5e (re)
663 \* test (4|13):33f7f61e6c5e (re)
664 $ hg --config extensions.mq=! unshelve
664 $ hg --config extensions.mq=! unshelve
665 unshelving change 'test'
665 unshelving change 'test'
666 $ hg bookmark
666 $ hg bookmark
667 \* test (4|13):33f7f61e6c5e (re)
667 \* test (4|13):33f7f61e6c5e (re)
668
668
669 Recreate some conflict again
669 Recreate some conflict again
670
670
671 $ hg up -C -r 2e69b451d1ea
671 $ hg up -C -r 2e69b451d1ea
672 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
672 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
673 (leaving bookmark test)
673 (leaving bookmark test)
674 $ echo y >> a/a
674 $ echo y >> a/a
675 $ hg shelve
675 $ hg shelve
676 shelved as default
676 shelved as default
677 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
677 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
678 $ hg up test
678 $ hg up test
679 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
679 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
680 (activating bookmark test)
680 (activating bookmark test)
681 $ hg bookmark
681 $ hg bookmark
682 \* test (4|13):33f7f61e6c5e (re)
682 \* test (4|13):33f7f61e6c5e (re)
683 $ hg unshelve
683 $ hg unshelve
684 unshelving change 'default'
684 unshelving change 'default'
685 rebasing shelved changes
685 rebasing shelved changes
686 merging a/a
686 merging a/a
687 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
687 warning: conflicts while merging a/a! (edit, then use 'hg resolve --mark')
688 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
688 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
689 [1]
689 [1]
690 $ hg bookmark
690 $ hg bookmark
691 test (4|13):33f7f61e6c5e (re)
691 test (4|13):33f7f61e6c5e (re)
692
692
693 Test that resolving all conflicts in one direction (so that the rebase
693 Test that resolving all conflicts in one direction (so that the rebase
694 is a no-op), works (issue4398)
694 is a no-op), works (issue4398)
695
695
696 $ hg revert -a -r .
696 $ hg revert -a -r .
697 reverting a/a
697 reverting a/a
698 $ hg resolve -m a/a
698 $ hg resolve -m a/a
699 (no more unresolved files)
699 (no more unresolved files)
700 continue: hg unshelve --continue
700 continue: hg unshelve --continue
701 $ hg unshelve -c
701 $ hg unshelve -c
702 note: unshelved changes already existed in the working copy
702 note: unshelved changes already existed in the working copy
703 unshelve of 'default' complete
703 unshelve of 'default' complete
704 $ hg bookmark
704 $ hg bookmark
705 \* test (4|13):33f7f61e6c5e (re)
705 \* test (4|13):33f7f61e6c5e (re)
706 $ hg diff
706 $ hg diff
707 $ hg status
707 $ hg status
708 ? a/a.orig
708 ? a/a.orig
709 ? foo/foo
709 ? foo/foo
710 $ hg summary
710 $ hg summary
711 parent: (4|13):33f7f61e6c5e tip (re)
711 parent: (4|13):33f7f61e6c5e tip (re)
712 create conflict
712 create conflict
713 branch: default
713 branch: default
714 bookmarks: *test
714 bookmarks: *test
715 commit: 2 unknown (clean)
715 commit: 2 unknown (clean)
716 update: (current)
716 update: (current)
717 phases: 5 draft
717 phases: 5 draft
718
718
719 $ hg shelve --delete --stat
719 $ hg shelve --delete --stat
720 abort: options '--delete' and '--stat' may not be used together
720 abort: options '--delete' and '--stat' may not be used together
721 [255]
721 [255]
722 $ hg shelve --delete --name NAME
722 $ hg shelve --delete --name NAME
723 abort: options '--delete' and '--name' may not be used together
723 abort: options '--delete' and '--name' may not be used together
724 [255]
724 [255]
725
725
726 Test interactive shelve
726 Test interactive shelve
727 $ cat <<EOF >> $HGRCPATH
727 $ cat <<EOF >> $HGRCPATH
728 > [ui]
728 > [ui]
729 > interactive = true
729 > interactive = true
730 > EOF
730 > EOF
731 $ echo 'a' >> a/b
731 $ echo 'a' >> a/b
732 $ cat a/a >> a/b
732 $ cat a/a >> a/b
733 $ echo 'x' >> a/b
733 $ echo 'x' >> a/b
734 $ mv a/b a/a
734 $ mv a/b a/a
735 $ echo 'a' >> foo/foo
735 $ echo 'a' >> foo/foo
736 $ hg st
736 $ hg st
737 M a/a
737 M a/a
738 ? a/a.orig
738 ? a/a.orig
739 ? foo/foo
739 ? foo/foo
740 $ cat a/a
740 $ cat a/a
741 a
741 a
742 a
742 a
743 c
743 c
744 x
744 x
745 x
745 x
746 $ cat foo/foo
746 $ cat foo/foo
747 foo
747 foo
748 a
748 a
749 $ hg shelve --interactive --config ui.interactive=false
749 $ hg shelve --interactive --config ui.interactive=false
750 abort: running non-interactively
750 abort: running non-interactively
751 [255]
751 [255]
752 $ hg shelve --interactive << EOF
752 $ hg shelve --interactive << EOF
753 > y
753 > y
754 > y
754 > y
755 > n
755 > n
756 > EOF
756 > EOF
757 diff --git a/a/a b/a/a
757 diff --git a/a/a b/a/a
758 2 hunks, 2 lines changed
758 2 hunks, 2 lines changed
759 examine changes to 'a/a'?
759 examine changes to 'a/a'?
760 (enter ? for help) [Ynesfdaq?] y
760 (enter ? for help) [Ynesfdaq?] y
761
761
762 @@ -1,3 +1,4 @@
762 @@ -1,3 +1,4 @@
763 +a
763 +a
764 a
764 a
765 c
765 c
766 x
766 x
767 record change 1/2 to 'a/a'?
767 record change 1/2 to 'a/a'?
768 (enter ? for help) [Ynesfdaq?] y
768 (enter ? for help) [Ynesfdaq?] y
769
769
770 @@ -1,3 +2,4 @@
770 @@ -1,3 +2,4 @@
771 a
771 a
772 c
772 c
773 x
773 x
774 +x
774 +x
775 record change 2/2 to 'a/a'?
775 record change 2/2 to 'a/a'?
776 (enter ? for help) [Ynesfdaq?] n
776 (enter ? for help) [Ynesfdaq?] n
777
777
778 shelved as test
778 shelved as test
779 merging a/a
779 merging a/a
780 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
780 0 files updated, 1 files merged, 0 files removed, 0 files unresolved
781 $ cat a/a
781 $ cat a/a
782 a
782 a
783 c
783 c
784 x
784 x
785 x
785 x
786 $ cat foo/foo
786 $ cat foo/foo
787 foo
787 foo
788 a
788 a
789 $ hg st
789 $ hg st
790 M a/a
790 M a/a
791 ? foo/foo
791 ? foo/foo
792 $ hg bookmark
792 $ hg bookmark
793 \* test (4|13):33f7f61e6c5e (re)
793 \* test (4|13):33f7f61e6c5e (re)
794 $ hg unshelve
794 $ hg unshelve
795 unshelving change 'test'
795 unshelving change 'test'
796 temporarily committing pending changes (restore with 'hg unshelve --abort')
796 temporarily committing pending changes (restore with 'hg unshelve --abort')
797 rebasing shelved changes
797 rebasing shelved changes
798 merging a/a
798 merging a/a
799 $ hg bookmark
799 $ hg bookmark
800 \* test (4|13):33f7f61e6c5e (re)
800 \* test (4|13):33f7f61e6c5e (re)
801 $ cat a/a
801 $ cat a/a
802 a
802 a
803 a
803 a
804 c
804 c
805 x
805 x
806 x
806 x
807
807
808 shelve --patch and shelve --stat should work with valid shelfnames
808 shelve --patch and shelve --stat should work with valid shelfnames
809
809
810 $ hg up --clean .
810 $ hg up --clean .
811 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
811 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
812 (leaving bookmark test)
812 (leaving bookmark test)
813 $ hg shelve --list
813 $ hg shelve --list
814 $ echo 'patch a' > shelf-patch-a
814 $ echo 'patch a' > shelf-patch-a
815 $ hg add shelf-patch-a
815 $ hg add shelf-patch-a
816 $ hg shelve
816 $ hg shelve
817 shelved as default
817 shelved as default
818 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
818 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
819 $ echo 'patch b' > shelf-patch-b
819 $ echo 'patch b' > shelf-patch-b
820 $ hg add shelf-patch-b
820 $ hg add shelf-patch-b
821 $ hg shelve
821 $ hg shelve
822 shelved as default-01
822 shelved as default-01
823 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
823 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
824 $ hg shelve --patch default default-01
824 $ hg shelve --patch default default-01
825 default-01 (*)* changes to: create conflict (glob)
825 default-01 (*)* changes to: create conflict (glob)
826
826
827 diff --git a/shelf-patch-b b/shelf-patch-b
827 diff --git a/shelf-patch-b b/shelf-patch-b
828 new file mode 100644
828 new file mode 100644
829 --- /dev/null
829 --- /dev/null
830 +++ b/shelf-patch-b
830 +++ b/shelf-patch-b
831 @@ -0,0 +1,1 @@
831 @@ -0,0 +1,1 @@
832 +patch b
832 +patch b
833 default (*)* changes to: create conflict (glob)
833 default (*)* changes to: create conflict (glob)
834
834
835 diff --git a/shelf-patch-a b/shelf-patch-a
835 diff --git a/shelf-patch-a b/shelf-patch-a
836 new file mode 100644
836 new file mode 100644
837 --- /dev/null
837 --- /dev/null
838 +++ b/shelf-patch-a
838 +++ b/shelf-patch-a
839 @@ -0,0 +1,1 @@
839 @@ -0,0 +1,1 @@
840 +patch a
840 +patch a
841 $ hg shelve --stat default default-01
841 $ hg shelve --stat default default-01
842 default-01 (*)* changes to: create conflict (glob)
842 default-01 (*)* changes to: create conflict (glob)
843 shelf-patch-b | 1 +
843 shelf-patch-b | 1 +
844 1 files changed, 1 insertions(+), 0 deletions(-)
844 1 files changed, 1 insertions(+), 0 deletions(-)
845 default (*)* changes to: create conflict (glob)
845 default (*)* changes to: create conflict (glob)
846 shelf-patch-a | 1 +
846 shelf-patch-a | 1 +
847 1 files changed, 1 insertions(+), 0 deletions(-)
847 1 files changed, 1 insertions(+), 0 deletions(-)
848 $ hg shelve --patch default
848 $ hg shelve --patch default
849 default (*)* changes to: create conflict (glob)
849 default (*)* changes to: create conflict (glob)
850
850
851 diff --git a/shelf-patch-a b/shelf-patch-a
851 diff --git a/shelf-patch-a b/shelf-patch-a
852 new file mode 100644
852 new file mode 100644
853 --- /dev/null
853 --- /dev/null
854 +++ b/shelf-patch-a
854 +++ b/shelf-patch-a
855 @@ -0,0 +1,1 @@
855 @@ -0,0 +1,1 @@
856 +patch a
856 +patch a
857 $ hg shelve --stat default
857 $ hg shelve --stat default
858 default (*)* changes to: create conflict (glob)
858 default (*)* changes to: create conflict (glob)
859 shelf-patch-a | 1 +
859 shelf-patch-a | 1 +
860 1 files changed, 1 insertions(+), 0 deletions(-)
860 1 files changed, 1 insertions(+), 0 deletions(-)
861 $ hg shelve --patch nonexistentshelf
861 $ hg shelve --patch nonexistentshelf
862 abort: cannot find shelf nonexistentshelf
862 abort: cannot find shelf nonexistentshelf
863 [255]
863 [255]
864 $ hg shelve --stat nonexistentshelf
864 $ hg shelve --stat nonexistentshelf
865 abort: cannot find shelf nonexistentshelf
865 abort: cannot find shelf nonexistentshelf
866 [255]
866 [255]
867 $ hg shelve --patch default nonexistentshelf
867 $ hg shelve --patch default nonexistentshelf
868 abort: cannot find shelf nonexistentshelf
868 abort: cannot find shelf nonexistentshelf
869 [255]
869 [255]
870
870
871 when the user asks for a patch, we assume they want the most recent shelve if
871 when the user asks for a patch, we assume they want the most recent shelve if
872 they don't provide a shelve name
872 they don't provide a shelve name
873
873
874 $ hg shelve --patch
874 $ hg shelve --patch
875 default-01 (*)* changes to: create conflict (glob)
875 default-01 (*)* changes to: create conflict (glob)
876
876
877 diff --git a/shelf-patch-b b/shelf-patch-b
877 diff --git a/shelf-patch-b b/shelf-patch-b
878 new file mode 100644
878 new file mode 100644
879 --- /dev/null
879 --- /dev/null
880 +++ b/shelf-patch-b
880 +++ b/shelf-patch-b
881 @@ -0,0 +1,1 @@
881 @@ -0,0 +1,1 @@
882 +patch b
882 +patch b
883
883
884 $ cd ..
884 $ cd ..
885
885
886 Shelve from general delta repo uses bundle2 on disk
886 Shelve from general delta repo uses bundle2 on disk
887 --------------------------------------------------
887 --------------------------------------------------
888
888
889 no general delta
889 no general delta
890
890
891 $ hg clone --pull repo bundle1 --config format.usegeneraldelta=0
891 $ hg clone --pull repo bundle1 --config format.usegeneraldelta=0
892 requesting all changes
892 requesting all changes
893 adding changesets
893 adding changesets
894 adding manifests
894 adding manifests
895 adding file changes
895 adding file changes
896 added 5 changesets with 8 changes to 6 files
896 added 5 changesets with 8 changes to 6 files
897 new changesets cc01e2b0c59f:33f7f61e6c5e
897 new changesets cc01e2b0c59f:33f7f61e6c5e
898 updating to branch default
898 updating to branch default
899 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
899 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
900 $ cd bundle1
900 $ cd bundle1
901 $ echo babar > jungle
901 $ echo babar > jungle
902 $ hg add jungle
902 $ hg add jungle
903 $ hg shelve
903 $ hg shelve
904 shelved as default
904 shelved as default
905 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
905 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
906 $ hg debugbundle .hg/shelved/*.hg
906 $ hg debugbundle .hg/shelved/*.hg
907 330882a04d2ce8487636b1fb292e5beea77fa1e3
907 330882a04d2ce8487636b1fb292e5beea77fa1e3
908 $ cd ..
908 $ cd ..
909
909
910 with general delta
910 with general delta
911
911
912 $ hg clone --pull repo bundle2 --config format.usegeneraldelta=1
912 $ hg clone --pull repo bundle2 --config format.usegeneraldelta=1
913 requesting all changes
913 requesting all changes
914 adding changesets
914 adding changesets
915 adding manifests
915 adding manifests
916 adding file changes
916 adding file changes
917 added 5 changesets with 8 changes to 6 files
917 added 5 changesets with 8 changes to 6 files
918 new changesets cc01e2b0c59f:33f7f61e6c5e
918 new changesets cc01e2b0c59f:33f7f61e6c5e
919 updating to branch default
919 updating to branch default
920 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
920 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
921 $ cd bundle2
921 $ cd bundle2
922 $ echo babar > jungle
922 $ echo babar > jungle
923 $ hg add jungle
923 $ hg add jungle
924 $ hg shelve
924 $ hg shelve
925 shelved as default
925 shelved as default
926 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
926 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
927 $ hg debugbundle .hg/shelved/*.hg
927 $ hg debugbundle .hg/shelved/*.hg
928 Stream params: {Compression: BZ}
928 Stream params: {Compression: BZ}
929 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
929 changegroup -- {nbchanges: 1, version: 02} (mandatory: True)
930 330882a04d2ce8487636b1fb292e5beea77fa1e3
930 330882a04d2ce8487636b1fb292e5beea77fa1e3
931
931
932 Test shelve --keep
932 Test shelve --keep
933
933
934 $ hg unshelve
934 $ hg unshelve
935 unshelving change 'default'
935 unshelving change 'default'
936 $ hg shelve --keep --list
936 $ hg shelve --keep --list
937 abort: options '--list' and '--keep' may not be used together
937 abort: options '--list' and '--keep' may not be used together
938 [255]
938 [255]
939 $ hg shelve --keep --patch
939 $ hg shelve --keep --patch
940 abort: options '--patch' and '--keep' may not be used together
940 abort: options '--patch' and '--keep' may not be used together
941 [255]
941 [255]
942 $ hg shelve --keep --delete
942 $ hg shelve --keep --delete
943 abort: options '--delete' and '--keep' may not be used together
943 abort: options '--delete' and '--keep' may not be used together
944 [255]
944 [255]
945 $ hg shelve --keep
945 $ hg shelve --keep
946 shelved as default
946 shelved as default
947 $ hg diff
947 $ hg diff
948 diff --git a/jungle b/jungle
948 diff --git a/jungle b/jungle
949 new file mode 100644
949 new file mode 100644
950 --- /dev/null
950 --- /dev/null
951 +++ b/jungle
951 +++ b/jungle
952 @@ -0,0 +1,1 @@
952 @@ -0,0 +1,1 @@
953 +babar
953 +babar
954 $ cd ..
954 $ cd ..
955
955
956 Test visibility of in-memory changes inside transaction to external hook
956 Test visibility of in-memory changes inside transaction to external hook
957 ------------------------------------------------------------------------
957 ------------------------------------------------------------------------
958
958
959 $ cd repo
959 $ cd repo
960
960
961 $ echo xxxx >> x
961 $ echo xxxx >> x
962 $ hg commit -m "#5: changes to invoke rebase"
962 $ hg commit -m "#5: changes to invoke rebase"
963
963
964 $ cat > $TESTTMP/checkvisibility.sh <<EOF
964 $ cat > $TESTTMP/checkvisibility.sh <<EOF
965 > echo "==== \$1:"
965 > echo "==== \$1:"
966 > hg parents --template "VISIBLE {rev}:{node|short}\n"
966 > hg parents --template "VISIBLE {rev}:{node|short}\n"
967 > # test that pending changes are hidden
967 > # test that pending changes are hidden
968 > unset HG_PENDING
968 > unset HG_PENDING
969 > hg parents --template "ACTUAL {rev}:{node|short}\n"
969 > hg parents --template "ACTUAL {rev}:{node|short}\n"
970 > echo "===="
970 > echo "===="
971 > EOF
971 > EOF
972
972
973 $ cat >> .hg/hgrc <<EOF
973 $ cat >> .hg/hgrc <<EOF
974 > [defaults]
974 > [defaults]
975 > # to fix hash id of temporary revisions
975 > # to fix hash id of temporary revisions
976 > unshelve = --date '0 0'
976 > unshelve = --date '0 0'
977 > EOF
977 > EOF
978
978
979 "hg unshelve" at REV5 implies steps below:
979 "hg unshelve" at REV5 implies steps below:
980
980
981 (1) commit changes in the working directory (REV6)
981 (1) commit changes in the working directory (REV6)
982 (2) unbundle shelved revision (REV7)
982 (2) unbundle shelved revision (REV7)
983 (3) rebase: merge REV7 into REV6 (REV6 => REV6, REV7)
983 (3) rebase: merge REV7 into REV6 (REV6 => REV6, REV7)
984 (4) rebase: commit merged revision (REV8)
984 (4) rebase: commit merged revision (REV8)
985 (5) rebase: update to REV6 (REV8 => REV6)
985 (5) rebase: update to REV6 (REV8 => REV6)
986 (6) update to REV5 (REV6 => REV5)
986 (6) update to REV5 (REV6 => REV5)
987 (7) abort transaction
987 (7) abort transaction
988
988
989 == test visibility to external preupdate hook
989 == test visibility to external preupdate hook
990
990
991 $ cat >> .hg/hgrc <<EOF
991 $ cat >> .hg/hgrc <<EOF
992 > [hooks]
992 > [hooks]
993 > preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate
993 > preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate
994 > EOF
994 > EOF
995
995
996 $ echo nnnn >> n
996 $ echo nnnn >> n
997
997
998 $ sh $TESTTMP/checkvisibility.sh before-unshelving
998 $ sh $TESTTMP/checkvisibility.sh before-unshelving
999 ==== before-unshelving:
999 ==== before-unshelving:
1000 VISIBLE (5|19):703117a2acfb (re)
1000 VISIBLE (5|19):703117a2acfb (re)
1001 ACTUAL (5|19):703117a2acfb (re)
1001 ACTUAL (5|19):703117a2acfb (re)
1002 ====
1002 ====
1003
1003
1004 $ hg unshelve --keep default
1004 $ hg unshelve --keep default
1005 temporarily committing pending changes (restore with 'hg unshelve --abort')
1005 temporarily committing pending changes (restore with 'hg unshelve --abort')
1006 rebasing shelved changes
1006 rebasing shelved changes
1007 ==== preupdate:
1007 ==== preupdate:
1008 VISIBLE (6|20):54c00d20fb3f (re)
1008 VISIBLE (6|20):54c00d20fb3f (re)
1009 ACTUAL (5|19):703117a2acfb (re)
1009 ACTUAL (5|19):703117a2acfb (re)
1010 ====
1010 ====
1011 ==== preupdate:
1011 ==== preupdate:
1012 VISIBLE (8|21):8efe6f7537dc (re)
1012 VISIBLE (8|21):8efe6f7537dc (re)
1013 ACTUAL (5|19):703117a2acfb (re)
1013 ACTUAL (5|19):703117a2acfb (re)
1014 ====
1014 ====
1015 ==== preupdate:
1015 ==== preupdate:
1016 VISIBLE (6|20):54c00d20fb3f (re)
1016 VISIBLE (6|20):54c00d20fb3f (re)
1017 ACTUAL (5|19):703117a2acfb (re)
1017 ACTUAL (5|19):703117a2acfb (re)
1018 ====
1018 ====
1019
1019
1020 $ cat >> .hg/hgrc <<EOF
1020 $ cat >> .hg/hgrc <<EOF
1021 > [hooks]
1021 > [hooks]
1022 > preupdate.visibility =
1022 > preupdate.visibility =
1023 > EOF
1023 > EOF
1024
1024
1025 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1025 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1026 ==== after-unshelving:
1026 ==== after-unshelving:
1027 VISIBLE (5|19):703117a2acfb (re)
1027 VISIBLE (5|19):703117a2acfb (re)
1028 ACTUAL (5|19):703117a2acfb (re)
1028 ACTUAL (5|19):703117a2acfb (re)
1029 ====
1029 ====
1030
1030
1031 == test visibility to external update hook
1031 == test visibility to external update hook
1032
1032
1033 $ hg update -q -C 703117a2acfb
1033 $ hg update -q -C 703117a2acfb
1034
1034
1035 $ cat >> .hg/hgrc <<EOF
1035 $ cat >> .hg/hgrc <<EOF
1036 > [hooks]
1036 > [hooks]
1037 > update.visibility = sh $TESTTMP/checkvisibility.sh update
1037 > update.visibility = sh $TESTTMP/checkvisibility.sh update
1038 > EOF
1038 > EOF
1039
1039
1040 $ echo nnnn >> n
1040 $ echo nnnn >> n
1041
1041
1042 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1042 $ sh $TESTTMP/checkvisibility.sh before-unshelving
1043 ==== before-unshelving:
1043 ==== before-unshelving:
1044 VISIBLE (5|19):703117a2acfb (re)
1044 VISIBLE (5|19):703117a2acfb (re)
1045 ACTUAL (5|19):703117a2acfb (re)
1045 ACTUAL (5|19):703117a2acfb (re)
1046 ====
1046 ====
1047
1047
1048 $ hg unshelve --keep default
1048 $ hg unshelve --keep default
1049 temporarily committing pending changes (restore with 'hg unshelve --abort')
1049 temporarily committing pending changes (restore with 'hg unshelve --abort')
1050 rebasing shelved changes
1050 rebasing shelved changes
1051 ==== update:
1051 ==== update:
1052 VISIBLE (6|20):54c00d20fb3f (re)
1052 VISIBLE (6|20):54c00d20fb3f (re)
1053 VISIBLE 1?7:492ed9d705e5 (re)
1053 VISIBLE 1?7:492ed9d705e5 (re)
1054 ACTUAL (5|19):703117a2acfb (re)
1054 ACTUAL (5|19):703117a2acfb (re)
1055 ====
1055 ====
1056 ==== update:
1056 ==== update:
1057 VISIBLE (6|20):54c00d20fb3f (re)
1057 VISIBLE (6|20):54c00d20fb3f (re)
1058 ACTUAL (5|19):703117a2acfb (re)
1058 ACTUAL (5|19):703117a2acfb (re)
1059 ====
1059 ====
1060 ==== update:
1060 ==== update:
1061 VISIBLE (5|19):703117a2acfb (re)
1061 VISIBLE (5|19):703117a2acfb (re)
1062 ACTUAL (5|19):703117a2acfb (re)
1062 ACTUAL (5|19):703117a2acfb (re)
1063 ====
1063 ====
1064
1064
1065 $ cat >> .hg/hgrc <<EOF
1065 $ cat >> .hg/hgrc <<EOF
1066 > [hooks]
1066 > [hooks]
1067 > update.visibility =
1067 > update.visibility =
1068 > EOF
1068 > EOF
1069
1069
1070 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1070 $ sh $TESTTMP/checkvisibility.sh after-unshelving
1071 ==== after-unshelving:
1071 ==== after-unshelving:
1072 VISIBLE (5|19):703117a2acfb (re)
1072 VISIBLE (5|19):703117a2acfb (re)
1073 ACTUAL (5|19):703117a2acfb (re)
1073 ACTUAL (5|19):703117a2acfb (re)
1074 ====
1074 ====
1075
1075
1076 $ cd ..
1076 $ cd ..
1077
1077
1078 Keep active bookmark while (un)shelving even on shared repo (issue4940)
1078 Keep active bookmark while (un)shelving even on shared repo (issue4940)
1079 -----------------------------------------------------------------------
1079 -----------------------------------------------------------------------
1080
1080
1081 $ cat <<EOF >> $HGRCPATH
1081 $ cat <<EOF >> $HGRCPATH
1082 > [extensions]
1082 > [extensions]
1083 > share =
1083 > share =
1084 > EOF
1084 > EOF
1085
1085
1086 $ hg bookmarks -R repo
1086 $ hg bookmarks -R repo
1087 test (4|13):33f7f61e6c5e (re)
1087 test (4|13):33f7f61e6c5e (re)
1088 $ hg share -B repo share
1088 $ hg share -B repo share
1089 updating working directory
1089 updating working directory
1090 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1090 6 files updated, 0 files merged, 0 files removed, 0 files unresolved
1091 $ cd share
1091 $ cd share
1092
1092
1093 $ hg bookmarks
1093 $ hg bookmarks
1094 test (4|13):33f7f61e6c5e (re)
1094 test (4|13):33f7f61e6c5e (re)
1095 $ hg bookmarks foo
1095 $ hg bookmarks foo
1096 $ hg bookmarks
1096 $ hg bookmarks
1097 \* foo (5|19):703117a2acfb (re)
1097 \* foo (5|19):703117a2acfb (re)
1098 test (4|13):33f7f61e6c5e (re)
1098 test (4|13):33f7f61e6c5e (re)
1099 $ echo x >> x
1099 $ echo x >> x
1100 $ hg shelve
1100 $ hg shelve
1101 shelved as foo
1101 shelved as foo
1102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1102 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1103 $ hg bookmarks
1103 $ hg bookmarks
1104 \* foo (5|19):703117a2acfb (re)
1104 \* foo (5|19):703117a2acfb (re)
1105 test (4|13):33f7f61e6c5e (re)
1105 test (4|13):33f7f61e6c5e (re)
1106
1106
1107 $ hg unshelve
1107 $ hg unshelve
1108 unshelving change 'foo'
1108 unshelving change 'foo'
1109 $ hg bookmarks
1109 $ hg bookmarks
1110 \* foo (5|19):703117a2acfb (re)
1110 \* foo (5|19):703117a2acfb (re)
1111 test (4|13):33f7f61e6c5e (re)
1111 test (4|13):33f7f61e6c5e (re)
1112
1112
1113 $ cd ..
1113 $ cd ..
1114
1114
1115 Abort unshelve while merging (issue5123)
1115 Abort unshelve while merging (issue5123)
1116 ----------------------------------------
1116 ----------------------------------------
1117
1117
1118 $ hg init issue5123
1118 $ hg init issue5123
1119 $ cd issue5123
1119 $ cd issue5123
1120 $ echo > a
1120 $ echo > a
1121 $ hg ci -Am a
1121 $ hg ci -Am a
1122 adding a
1122 adding a
1123 $ hg co null
1123 $ hg co null
1124 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1124 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1125 $ echo > b
1125 $ echo > b
1126 $ hg ci -Am b
1126 $ hg ci -Am b
1127 adding b
1127 adding b
1128 created new head
1128 created new head
1129 $ echo > c
1129 $ echo > c
1130 $ hg add c
1130 $ hg add c
1131 $ hg shelve
1131 $ hg shelve
1132 shelved as default
1132 shelved as default
1133 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1133 0 files updated, 0 files merged, 1 files removed, 0 files unresolved
1134 $ hg co 1
1134 $ hg co 1
1135 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1135 0 files updated, 0 files merged, 0 files removed, 0 files unresolved
1136 $ hg merge 0
1136 $ hg merge 0
1137 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1137 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1138 (branch merge, don't forget to commit)
1138 (branch merge, don't forget to commit)
1139 -- successful merge with two parents
1139 -- successful merge with two parents
1140 $ hg log -G
1140 $ hg log -G
1141 @ changeset: 1:406bf70c274f
1141 @ changeset: 1:406bf70c274f
1142 tag: tip
1142 tag: tip
1143 parent: -1:000000000000
1143 parent: -1:000000000000
1144 user: test
1144 user: test
1145 date: Thu Jan 01 00:00:00 1970 +0000
1145 date: Thu Jan 01 00:00:00 1970 +0000
1146 summary: b
1146 summary: b
1147
1147
1148 @ changeset: 0:ada8c9eb8252
1148 @ changeset: 0:ada8c9eb8252
1149 user: test
1149 user: test
1150 date: Thu Jan 01 00:00:00 1970 +0000
1150 date: Thu Jan 01 00:00:00 1970 +0000
1151 summary: a
1151 summary: a
1152
1152
1153 -- trying to pull in the shelve bits
1153 -- trying to pull in the shelve bits
1154 -- unshelve should abort otherwise, it'll eat my second parent.
1154 -- unshelve should abort otherwise, it'll eat my second parent.
1155 $ hg unshelve
1155 $ hg unshelve
1156 abort: outstanding uncommitted merge
1156 abort: outstanding uncommitted merge
1157 (use 'hg commit' or 'hg merge --abort')
1157 (use 'hg commit' or 'hg merge --abort')
1158 [255]
1158 [255]
1159
1159
1160 $ cd ..
1160 $ cd ..
1161
1161
1162 -- test for interactive mode on unshelve
1162 -- test for interactive mode on unshelve
1163
1163
1164 $ hg init a
1164 $ hg init a
1165 $ cd a
1165 $ cd a
1166 $ echo > b
1166 $ echo > b
1167 $ hg ci -Am b
1167 $ hg ci -Am b
1168 adding b
1168 adding b
1169 $ echo > c
1169 $ echo > c
1170 $ echo > d
1170 $ echo > d
1171 $ hg add .
1171 $ hg add .
1172 adding c
1172 adding c
1173 adding d
1173 adding d
1174 $ hg shelve
1174 $ hg shelve
1175 shelved as default
1175 shelved as default
1176 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1176 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
1177 $ echo > e
1177 $ echo > e
1178 $ hg add e
1178 $ hg add e
1179 $ hg ci -m e
1179 $ hg ci -m e
1180 $ hg shelve --patch
1180 $ hg shelve --patch
1181 default (1s ago) changes to: b
1181 default (*s ago) changes to: b (glob)
1182
1182
1183 diff --git a/c b/c
1183 diff --git a/c b/c
1184 new file mode 100644
1184 new file mode 100644
1185 --- /dev/null
1185 --- /dev/null
1186 +++ b/c
1186 +++ b/c
1187 @@ -0,0 +1,1 @@
1187 @@ -0,0 +1,1 @@
1188 +
1188 +
1189 diff --git a/d b/d
1189 diff --git a/d b/d
1190 new file mode 100644
1190 new file mode 100644
1191 --- /dev/null
1191 --- /dev/null
1192 +++ b/d
1192 +++ b/d
1193 @@ -0,0 +1,1 @@
1193 @@ -0,0 +1,1 @@
1194 +
1194 +
1195 $ hg unshelve -i <<EOF
1195 $ hg unshelve -i <<EOF
1196 > y
1196 > y
1197 > y
1197 > y
1198 > y
1198 > y
1199 > n
1199 > n
1200 > EOF
1200 > EOF
1201 unshelving change 'default'
1201 unshelving change 'default'
1202 rebasing shelved changes
1202 rebasing shelved changes
1203 diff --git a/c b/c
1203 diff --git a/c b/c
1204 new file mode 100644
1204 new file mode 100644
1205 examine changes to 'c'?
1205 examine changes to 'c'?
1206 (enter ? for help) [Ynesfdaq?] y
1206 (enter ? for help) [Ynesfdaq?] y
1207
1207
1208 @@ -0,0 +1,1 @@
1208 @@ -0,0 +1,1 @@
1209 +
1209 +
1210 record change 1/2 to 'c'?
1210 record change 1/2 to 'c'?
1211 (enter ? for help) [Ynesfdaq?] y
1211 (enter ? for help) [Ynesfdaq?] y
1212
1212
1213 diff --git a/d b/d
1213 diff --git a/d b/d
1214 new file mode 100644
1214 new file mode 100644
1215 examine changes to 'd'?
1215 examine changes to 'd'?
1216 (enter ? for help) [Ynesfdaq?] y
1216 (enter ? for help) [Ynesfdaq?] y
1217
1217
1218 @@ -0,0 +1,1 @@
1218 @@ -0,0 +1,1 @@
1219 +
1219 +
1220 record change 2/2 to 'd'?
1220 record change 2/2 to 'd'?
1221 (enter ? for help) [Ynesfdaq?] n
1221 (enter ? for help) [Ynesfdaq?] n
1222
1222
1223 $ ls
1223 $ ls
1224 b
1224 b
1225 c
1225 c
1226 e
1226 e
1227 -- shelve should not contain `c` now
1227 -- shelve should not contain `c` now
1228 $ hg shelve --patch
1228 $ hg shelve --patch
1229 default (1s ago) changes to: b
1229 default (*s ago) changes to: b (glob)
1230
1230
1231 diff --git a/d b/d
1231 diff --git a/d b/d
1232 new file mode 100644
1232 new file mode 100644
1233 --- /dev/null
1233 --- /dev/null
1234 +++ b/d
1234 +++ b/d
1235 @@ -0,0 +1,1 @@
1235 @@ -0,0 +1,1 @@
1236 +
1236 +
1237 $ hg unshelve -i <<EOF
1237 $ hg unshelve -i <<EOF
1238 > y
1238 > y
1239 > y
1239 > y
1240 > EOF
1240 > EOF
1241 unshelving change 'default'
1241 unshelving change 'default'
1242 rebasing shelved changes
1242 rebasing shelved changes
1243 diff --git a/d b/d
1243 diff --git a/d b/d
1244 new file mode 100644
1244 new file mode 100644
1245 examine changes to 'd'?
1245 examine changes to 'd'?
1246 (enter ? for help) [Ynesfdaq?] y
1246 (enter ? for help) [Ynesfdaq?] y
1247
1247
1248 @@ -0,0 +1,1 @@
1248 @@ -0,0 +1,1 @@
1249 +
1249 +
1250 record this change to 'd'?
1250 record this change to 'd'?
1251 (enter ? for help) [Ynesfdaq?] y
1251 (enter ? for help) [Ynesfdaq?] y
1252
1252
1253 $ ls
1253 $ ls
1254 b
1254 b
1255 c
1255 c
1256 d
1256 d
1257 e
1257 e
1258 $ hg shelve --list
1258 $ hg shelve --list
1259
1259
1260 -- now, unshelve selected changes from a file
1260 -- now, unshelve selected changes from a file
1261
1261
1262 $ echo B > foo
1262 $ echo B > foo
1263 $ hg add foo
1263 $ hg add foo
1264 $ hg ci -m 'add B to foo'
1264 $ hg ci -m 'add B to foo'
1265 $ cat > foo <<EOF
1265 $ cat > foo <<EOF
1266 > A
1266 > A
1267 > B
1267 > B
1268 > C
1268 > C
1269 > EOF
1269 > EOF
1270 $ hg shelve
1270 $ hg shelve
1271 shelved as default
1271 shelved as default
1272 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1272 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
1273 $ cat foo
1273 $ cat foo
1274 B
1274 B
1275 $ hg unshelve -i <<EOF
1275 $ hg unshelve -i <<EOF
1276 > y
1276 > y
1277 > y
1277 > y
1278 > n
1278 > n
1279 > EOF
1279 > EOF
1280 unshelving change 'default'
1280 unshelving change 'default'
1281 rebasing shelved changes
1281 rebasing shelved changes
1282 diff --git a/foo b/foo
1282 diff --git a/foo b/foo
1283 2 hunks, 2 lines changed
1283 2 hunks, 2 lines changed
1284 examine changes to 'foo'?
1284 examine changes to 'foo'?
1285 (enter ? for help) [Ynesfdaq?] y
1285 (enter ? for help) [Ynesfdaq?] y
1286
1286
1287 @@ -1,1 +1,2 @@
1287 @@ -1,1 +1,2 @@
1288 +A
1288 +A
1289 B
1289 B
1290 record change 1/2 to 'foo'?
1290 record change 1/2 to 'foo'?
1291 (enter ? for help) [Ynesfdaq?] y
1291 (enter ? for help) [Ynesfdaq?] y
1292
1292
1293 @@ -1,1 +2,2 @@
1293 @@ -1,1 +2,2 @@
1294 B
1294 B
1295 +C
1295 +C
1296 record change 2/2 to 'foo'?
1296 record change 2/2 to 'foo'?
1297 (enter ? for help) [Ynesfdaq?] n
1297 (enter ? for help) [Ynesfdaq?] n
1298
1298
1299 $ cat foo
1299 $ cat foo
1300 A
1300 A
1301 B
1301 B
1302 $ hg shelve --patch
1302 $ hg shelve --patch
1303 default (1s ago) changes to: add B to foo
1303 default (*s ago) changes to: add B to foo (glob)
1304
1304
1305 diff --git a/foo b/foo
1305 diff --git a/foo b/foo
1306 --- a/foo
1306 --- a/foo
1307 +++ b/foo
1307 +++ b/foo
1308 @@ -1,2 +1,3 @@
1308 @@ -1,2 +1,3 @@
1309 A
1309 A
1310 B
1310 B
1311 +C
1311 +C
1312
1312
1313 -- unshelve interactive on conflicts
1313 -- unshelve interactive on conflicts
1314
1314
1315 $ echo A >> bar1
1315 $ echo A >> bar1
1316 $ echo A >> bar2
1316 $ echo A >> bar2
1317 $ hg add bar1 bar2
1317 $ hg add bar1 bar2
1318 $ hg ci -m 'add A to bars'
1318 $ hg ci -m 'add A to bars'
1319 $ echo B >> bar1
1319 $ echo B >> bar1
1320 $ echo B >> bar2
1320 $ echo B >> bar2
1321 $ hg shelve
1321 $ hg shelve
1322 shelved as default-01
1322 shelved as default-01
1323 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1323 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
1324 $ echo C >> bar1
1324 $ echo C >> bar1
1325 $ echo C >> bar2
1325 $ echo C >> bar2
1326 $ hg ci -m 'add C to bars'
1326 $ hg ci -m 'add C to bars'
1327 $ hg unshelve -i
1327 $ hg unshelve -i
1328 unshelving change 'default-01'
1328 unshelving change 'default-01'
1329 rebasing shelved changes
1329 rebasing shelved changes
1330 merging bar1
1330 merging bar1
1331 merging bar2
1331 merging bar2
1332 warning: conflicts while merging bar1! (edit, then use 'hg resolve --mark')
1332 warning: conflicts while merging bar1! (edit, then use 'hg resolve --mark')
1333 warning: conflicts while merging bar2! (edit, then use 'hg resolve --mark')
1333 warning: conflicts while merging bar2! (edit, then use 'hg resolve --mark')
1334 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
1334 unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
1335 [1]
1335 [1]
1336
1336
1337 $ cat > bar1 <<EOF
1337 $ cat > bar1 <<EOF
1338 > A
1338 > A
1339 > B
1339 > B
1340 > C
1340 > C
1341 > EOF
1341 > EOF
1342 $ cat > bar2 <<EOF
1342 $ cat > bar2 <<EOF
1343 > A
1343 > A
1344 > B
1344 > B
1345 > C
1345 > C
1346 > EOF
1346 > EOF
1347 $ hg resolve -m bar1 bar2
1347 $ hg resolve -m bar1 bar2
1348 (no more unresolved files)
1348 (no more unresolved files)
1349 continue: hg unshelve --continue
1349 continue: hg unshelve --continue
1350 $ cat bar1
1350 $ cat bar1
1351 A
1351 A
1352 B
1352 B
1353 C
1353 C
1354 $ hg unshelve --continue -i <<EOF
1354 $ hg unshelve --continue -i <<EOF
1355 > y
1355 > y
1356 > y
1356 > y
1357 > y
1357 > y
1358 > y
1358 > y
1359 > EOF
1359 > EOF
1360 unshelving change 'default-01'
1360 unshelving change 'default-01'
1361 diff --git a/bar1 b/bar1
1361 diff --git a/bar1 b/bar1
1362 1 hunks, 1 lines changed
1362 1 hunks, 1 lines changed
1363 examine changes to 'bar1'?
1363 examine changes to 'bar1'?
1364 (enter ? for help) [Ynesfdaq?] y
1364 (enter ? for help) [Ynesfdaq?] y
1365
1365
1366 @@ -1,2 +1,3 @@
1366 @@ -1,2 +1,3 @@
1367 A
1367 A
1368 +B
1368 +B
1369 C
1369 C
1370 record change 1/2 to 'bar1'?
1370 record change 1/2 to 'bar1'?
1371 (enter ? for help) [Ynesfdaq?] y
1371 (enter ? for help) [Ynesfdaq?] y
1372
1372
1373 diff --git a/bar2 b/bar2
1373 diff --git a/bar2 b/bar2
1374 1 hunks, 1 lines changed
1374 1 hunks, 1 lines changed
1375 examine changes to 'bar2'?
1375 examine changes to 'bar2'?
1376 (enter ? for help) [Ynesfdaq?] y
1376 (enter ? for help) [Ynesfdaq?] y
1377
1377
1378 @@ -1,2 +1,3 @@
1378 @@ -1,2 +1,3 @@
1379 A
1379 A
1380 +B
1380 +B
1381 C
1381 C
1382 record change 2/2 to 'bar2'?
1382 record change 2/2 to 'bar2'?
1383 (enter ? for help) [Ynesfdaq?] y
1383 (enter ? for help) [Ynesfdaq?] y
1384
1384
1385 unshelve of 'default-01' complete
1385 unshelve of 'default-01' complete
General Comments 0
You need to be logged in to leave comments. Login now