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