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