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