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