Show More
@@ -1,662 +1,666 b'' | |||||
1 | $ echo "[extensions]" >> $HGRCPATH |
|
1 | $ echo "[extensions]" >> $HGRCPATH | |
2 | $ echo "mq=" >> $HGRCPATH |
|
2 | $ echo "mq=" >> $HGRCPATH | |
3 | $ echo "shelve=" >> $HGRCPATH |
|
3 | $ echo "shelve=" >> $HGRCPATH | |
4 | $ echo "[defaults]" >> $HGRCPATH |
|
4 | $ echo "[defaults]" >> $HGRCPATH | |
5 | $ echo "diff = --nodates --git" >> $HGRCPATH |
|
5 | $ echo "diff = --nodates --git" >> $HGRCPATH | |
6 | $ echo "qnew = --date '0 0'" >> $HGRCPATH |
|
6 | $ echo "qnew = --date '0 0'" >> $HGRCPATH | |
7 |
|
7 | |||
8 | $ hg init repo |
|
8 | $ hg init repo | |
9 | $ cd repo |
|
9 | $ cd repo | |
10 | $ mkdir a b |
|
10 | $ mkdir a b | |
11 | $ echo a > a/a |
|
11 | $ echo a > a/a | |
12 | $ echo b > b/b |
|
12 | $ echo b > b/b | |
13 | $ echo c > c |
|
13 | $ echo c > c | |
14 | $ echo d > d |
|
14 | $ echo d > d | |
15 | $ echo x > x |
|
15 | $ echo x > x | |
16 | $ hg addremove -q |
|
16 | $ hg addremove -q | |
17 |
|
17 | |||
18 | shelving in an empty repo should be possible |
|
18 | shelving in an empty repo should be possible | |
19 |
|
19 | |||
20 | $ hg shelve |
|
20 | $ hg shelve | |
21 | shelved as default |
|
21 | shelved as default | |
22 | 0 files updated, 0 files merged, 5 files removed, 0 files unresolved |
|
22 | 0 files updated, 0 files merged, 5 files removed, 0 files unresolved | |
23 |
|
23 | |||
24 | $ hg unshelve |
|
24 | $ hg unshelve | |
25 | unshelving change 'default' |
|
25 | unshelving change 'default' | |
26 |
|
26 | |||
27 | $ hg commit -q -m 'initial commit' |
|
27 | $ hg commit -q -m 'initial commit' | |
28 |
|
28 | |||
29 | $ hg shelve |
|
29 | $ hg shelve | |
30 | nothing changed |
|
30 | nothing changed | |
31 | [1] |
|
31 | [1] | |
32 |
|
32 | |||
33 | create an mq patch - shelving should work fine with a patch applied |
|
33 | create an mq patch - shelving should work fine with a patch applied | |
34 |
|
34 | |||
35 | $ echo n > n |
|
35 | $ echo n > n | |
36 | $ hg add n |
|
36 | $ hg add n | |
37 | $ hg commit n -m second |
|
37 | $ hg commit n -m second | |
38 | $ hg qnew second.patch |
|
38 | $ hg qnew second.patch | |
39 |
|
39 | |||
40 | shelve a change that we will delete later |
|
40 | shelve a change that we will delete later | |
41 |
|
41 | |||
42 | $ echo a >> a/a |
|
42 | $ echo a >> a/a | |
43 | $ hg shelve |
|
43 | $ hg shelve | |
44 | shelved as default |
|
44 | shelved as default | |
45 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
45 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
46 |
|
46 | |||
47 | set up some more complex changes to shelve |
|
47 | set up some more complex changes to shelve | |
48 |
|
48 | |||
49 | $ echo a >> a/a |
|
49 | $ echo a >> a/a | |
50 | $ hg mv b b.rename |
|
50 | $ hg mv b b.rename | |
51 | moving b/b to b.rename/b (glob) |
|
51 | moving b/b to b.rename/b (glob) | |
52 | $ hg cp c c.copy |
|
52 | $ hg cp c c.copy | |
53 | $ hg status -C |
|
53 | $ hg status -C | |
54 | M a/a |
|
54 | M a/a | |
55 | A b.rename/b |
|
55 | A b.rename/b | |
56 | b/b |
|
56 | b/b | |
57 | A c.copy |
|
57 | A c.copy | |
58 | c |
|
58 | c | |
59 | R b/b |
|
59 | R b/b | |
60 |
|
60 | |||
61 | prevent some foot-shooting |
|
61 | prevent some foot-shooting | |
62 |
|
62 | |||
63 | $ hg shelve -n foo/bar |
|
63 | $ hg shelve -n foo/bar | |
64 | abort: shelved change names may not contain slashes |
|
64 | abort: shelved change names may not contain slashes | |
65 | [255] |
|
65 | [255] | |
66 | $ hg shelve -n .baz |
|
66 | $ hg shelve -n .baz | |
67 | abort: shelved change names may not start with '.' |
|
67 | abort: shelved change names may not start with '.' | |
68 | [255] |
|
68 | [255] | |
69 |
|
69 | |||
70 | the common case - no options or filenames |
|
70 | the common case - no options or filenames | |
71 |
|
71 | |||
72 | $ hg shelve |
|
72 | $ hg shelve | |
73 | shelved as default-01 |
|
73 | shelved as default-01 | |
74 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
74 | 2 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
75 | $ hg status -C |
|
75 | $ hg status -C | |
76 |
|
76 | |||
77 | ensure that our shelved changes exist |
|
77 | ensure that our shelved changes exist | |
78 |
|
78 | |||
79 | $ hg shelve -l |
|
79 | $ hg shelve -l | |
80 | default-01 (*) changes to '[mq]: second.patch' (glob) |
|
80 | default-01 (*) changes to '[mq]: second.patch' (glob) | |
81 | default (*) changes to '[mq]: second.patch' (glob) |
|
81 | default (*) changes to '[mq]: second.patch' (glob) | |
82 |
|
82 | |||
83 | $ hg shelve -l -p default |
|
83 | $ hg shelve -l -p default | |
84 | default (*) changes to '[mq]: second.patch' (glob) |
|
84 | default (*) changes to '[mq]: second.patch' (glob) | |
85 |
|
85 | |||
86 | diff --git a/a/a b/a/a |
|
86 | diff --git a/a/a b/a/a | |
87 | --- a/a/a |
|
87 | --- a/a/a | |
88 | +++ b/a/a |
|
88 | +++ b/a/a | |
89 | @@ -1,1 +1,2 @@ |
|
89 | @@ -1,1 +1,2 @@ | |
90 | a |
|
90 | a | |
91 | +a |
|
91 | +a | |
92 |
|
92 | |||
93 | delete our older shelved change |
|
93 | delete our older shelved change | |
94 |
|
94 | |||
95 | $ hg shelve -d default |
|
95 | $ hg shelve -d default | |
96 | $ hg qfinish -a -q |
|
96 | $ hg qfinish -a -q | |
97 |
|
97 | |||
98 | local edits should not prevent a shelved change from applying |
|
98 | local edits should not prevent a shelved change from applying | |
99 |
|
99 | |||
100 | $ printf "z\na\n" > a/a |
|
100 | $ printf "z\na\n" > a/a | |
101 | $ hg unshelve --keep |
|
101 | $ hg unshelve --keep | |
102 | unshelving change 'default-01' |
|
102 | unshelving change 'default-01' | |
103 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
103 | temporarily committing pending changes (restore with 'hg unshelve --abort') | |
104 | rebasing shelved changes |
|
104 | rebasing shelved changes | |
105 | merging a/a |
|
105 | merging a/a | |
106 |
|
106 | |||
107 | $ hg revert --all -q |
|
107 | $ hg revert --all -q | |
108 | $ rm a/a.orig b.rename/b c.copy |
|
108 | $ rm a/a.orig b.rename/b c.copy | |
109 |
|
109 | |||
110 | apply it and make sure our state is as expected |
|
110 | apply it and make sure our state is as expected | |
111 |
|
111 | |||
112 | $ hg unshelve |
|
112 | $ hg unshelve | |
113 | unshelving change 'default-01' |
|
113 | unshelving change 'default-01' | |
114 | $ hg status -C |
|
114 | $ hg status -C | |
115 | M a/a |
|
115 | M a/a | |
116 | A b.rename/b |
|
116 | A b.rename/b | |
117 | b/b |
|
117 | b/b | |
118 | A c.copy |
|
118 | A c.copy | |
119 | c |
|
119 | c | |
120 | R b/b |
|
120 | R b/b | |
121 | $ hg shelve -l |
|
121 | $ hg shelve -l | |
122 |
|
122 | |||
123 | $ hg unshelve |
|
123 | $ hg unshelve | |
124 | abort: no shelved changes to apply! |
|
124 | abort: no shelved changes to apply! | |
125 | [255] |
|
125 | [255] | |
126 | $ hg unshelve foo |
|
126 | $ hg unshelve foo | |
127 | abort: shelved change 'foo' not found |
|
127 | abort: shelved change 'foo' not found | |
128 | [255] |
|
128 | [255] | |
129 |
|
129 | |||
130 | named shelves, specific filenames, and "commit messages" should all work |
|
130 | named shelves, specific filenames, and "commit messages" should all work | |
131 |
|
131 | |||
132 | $ hg status -C |
|
132 | $ hg status -C | |
133 | M a/a |
|
133 | M a/a | |
134 | A b.rename/b |
|
134 | A b.rename/b | |
135 | b/b |
|
135 | b/b | |
136 | A c.copy |
|
136 | A c.copy | |
137 | c |
|
137 | c | |
138 | R b/b |
|
138 | R b/b | |
139 | $ hg shelve -q -n wibble -m wat a |
|
139 | $ hg shelve -q -n wibble -m wat a | |
140 |
|
140 | |||
141 | expect "a" to no longer be present, but status otherwise unchanged |
|
141 | expect "a" to no longer be present, but status otherwise unchanged | |
142 |
|
142 | |||
143 | $ hg status -C |
|
143 | $ hg status -C | |
144 | A b.rename/b |
|
144 | A b.rename/b | |
145 | b/b |
|
145 | b/b | |
146 | A c.copy |
|
146 | A c.copy | |
147 | c |
|
147 | c | |
148 | R b/b |
|
148 | R b/b | |
149 | $ hg shelve -l --stat |
|
149 | $ hg shelve -l --stat | |
150 | wibble (*) wat (glob) |
|
150 | wibble (*) wat (glob) | |
151 | a/a | 1 + |
|
151 | a/a | 1 + | |
152 | 1 files changed, 1 insertions(+), 0 deletions(-) |
|
152 | 1 files changed, 1 insertions(+), 0 deletions(-) | |
153 |
|
153 | |||
154 | and now "a/a" should reappear |
|
154 | and now "a/a" should reappear | |
155 |
|
155 | |||
156 | $ cd a |
|
156 | $ cd a | |
157 | $ hg unshelve -q wibble |
|
157 | $ hg unshelve -q wibble | |
158 | $ cd .. |
|
158 | $ cd .. | |
159 | $ hg status -C |
|
159 | $ hg status -C | |
160 | M a/a |
|
160 | M a/a | |
161 | A b.rename/b |
|
161 | A b.rename/b | |
162 | b/b |
|
162 | b/b | |
163 | A c.copy |
|
163 | A c.copy | |
164 | c |
|
164 | c | |
165 | R b/b |
|
165 | R b/b | |
166 |
|
166 | |||
167 | cause unshelving to result in a merge with 'a' conflicting |
|
167 | cause unshelving to result in a merge with 'a' conflicting | |
168 |
|
168 | |||
169 | $ hg shelve -q |
|
169 | $ hg shelve -q | |
170 | $ echo c>>a/a |
|
170 | $ echo c>>a/a | |
171 | $ hg commit -m second |
|
171 | $ hg commit -m second | |
172 | $ hg tip --template '{files}\n' |
|
172 | $ hg tip --template '{files}\n' | |
173 | a/a |
|
173 | a/a | |
174 |
|
174 | |||
175 | add an unrelated change that should be preserved |
|
175 | add an unrelated change that should be preserved | |
176 |
|
176 | |||
177 | $ mkdir foo |
|
177 | $ mkdir foo | |
178 | $ echo foo > foo/foo |
|
178 | $ echo foo > foo/foo | |
179 | $ hg add foo/foo |
|
179 | $ hg add foo/foo | |
180 |
|
180 | |||
181 | force a conflicted merge to occur |
|
181 | force a conflicted merge to occur | |
182 |
|
182 | |||
183 | $ hg unshelve |
|
183 | $ hg unshelve | |
184 | unshelving change 'default' |
|
184 | unshelving change 'default' | |
185 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
185 | temporarily committing pending changes (restore with 'hg unshelve --abort') | |
186 | rebasing shelved changes |
|
186 | rebasing shelved changes | |
187 | merging a/a |
|
187 | merging a/a | |
188 | warning: conflicts during merge. |
|
188 | warning: conflicts during merge. | |
189 | merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
189 | merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark') | |
190 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
190 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') | |
191 | [1] |
|
191 | [1] | |
192 |
|
192 | |||
193 | ensure that we have a merge with unresolved conflicts |
|
193 | ensure that we have a merge with unresolved conflicts | |
194 |
|
194 | |||
195 | $ hg heads -q --template '{rev}\n' |
|
195 | $ hg heads -q --template '{rev}\n' | |
196 | 5 |
|
196 | 5 | |
197 | 4 |
|
197 | 4 | |
198 | $ hg parents -q --template '{rev}\n' |
|
198 | $ hg parents -q --template '{rev}\n' | |
199 | 4 |
|
199 | 4 | |
200 | 5 |
|
200 | 5 | |
201 | $ hg status |
|
201 | $ hg status | |
202 | M a/a |
|
202 | M a/a | |
203 | M b.rename/b |
|
203 | M b.rename/b | |
204 | M c.copy |
|
204 | M c.copy | |
205 | R b/b |
|
205 | R b/b | |
206 | ? a/a.orig |
|
206 | ? a/a.orig | |
207 | $ hg diff |
|
207 | $ hg diff | |
208 | diff --git a/a/a b/a/a |
|
208 | diff --git a/a/a b/a/a | |
209 | --- a/a/a |
|
209 | --- a/a/a | |
210 | +++ b/a/a |
|
210 | +++ b/a/a | |
211 | @@ -1,2 +1,6 @@ |
|
211 | @@ -1,2 +1,6 @@ | |
212 | a |
|
212 | a | |
213 | +<<<<<<< local |
|
213 | +<<<<<<< local | |
214 | c |
|
214 | c | |
215 | +======= |
|
215 | +======= | |
216 | +a |
|
216 | +a | |
217 | +>>>>>>> other |
|
217 | +>>>>>>> other | |
218 | diff --git a/b.rename/b b/b.rename/b |
|
218 | diff --git a/b.rename/b b/b.rename/b | |
219 | new file mode 100644 |
|
219 | new file mode 100644 | |
220 | --- /dev/null |
|
220 | --- /dev/null | |
221 | +++ b/b.rename/b |
|
221 | +++ b/b.rename/b | |
222 | @@ -0,0 +1,1 @@ |
|
222 | @@ -0,0 +1,1 @@ | |
223 | +b |
|
223 | +b | |
224 | diff --git a/b/b b/b/b |
|
224 | diff --git a/b/b b/b/b | |
225 | deleted file mode 100644 |
|
225 | deleted file mode 100644 | |
226 | --- a/b/b |
|
226 | --- a/b/b | |
227 | +++ /dev/null |
|
227 | +++ /dev/null | |
228 | @@ -1,1 +0,0 @@ |
|
228 | @@ -1,1 +0,0 @@ | |
229 | -b |
|
229 | -b | |
230 | diff --git a/c.copy b/c.copy |
|
230 | diff --git a/c.copy b/c.copy | |
231 | new file mode 100644 |
|
231 | new file mode 100644 | |
232 | --- /dev/null |
|
232 | --- /dev/null | |
233 | +++ b/c.copy |
|
233 | +++ b/c.copy | |
234 | @@ -0,0 +1,1 @@ |
|
234 | @@ -0,0 +1,1 @@ | |
235 | +c |
|
235 | +c | |
236 | $ hg resolve -l |
|
236 | $ hg resolve -l | |
237 | U a/a |
|
237 | U a/a | |
238 |
|
238 | |||
239 | $ hg shelve |
|
239 | $ hg shelve | |
240 | abort: unshelve already in progress |
|
240 | abort: unshelve already in progress | |
241 | (use 'hg unshelve --continue' or 'hg unshelve --abort') |
|
241 | (use 'hg unshelve --continue' or 'hg unshelve --abort') | |
242 | [255] |
|
242 | [255] | |
243 |
|
243 | |||
244 | abort the unshelve and be happy |
|
244 | abort the unshelve and be happy | |
245 |
|
245 | |||
246 | $ hg status |
|
246 | $ hg status | |
247 | M a/a |
|
247 | M a/a | |
248 | M b.rename/b |
|
248 | M b.rename/b | |
249 | M c.copy |
|
249 | M c.copy | |
250 | R b/b |
|
250 | R b/b | |
251 | ? a/a.orig |
|
251 | ? a/a.orig | |
252 | $ hg unshelve -a |
|
252 | $ hg unshelve -a | |
253 | rebase aborted |
|
253 | rebase aborted | |
254 | unshelve of 'default' aborted |
|
254 | unshelve of 'default' aborted | |
255 | $ hg heads -q |
|
255 | $ hg heads -q | |
256 | 3:2e69b451d1ea |
|
256 | 3:2e69b451d1ea | |
257 | $ hg parents |
|
257 | $ hg parents | |
258 | changeset: 3:2e69b451d1ea |
|
258 | changeset: 3:2e69b451d1ea | |
259 | tag: tip |
|
259 | tag: tip | |
260 | user: test |
|
260 | user: test | |
261 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
261 | date: Thu Jan 01 00:00:00 1970 +0000 | |
262 | summary: second |
|
262 | summary: second | |
263 |
|
263 | |||
264 | $ hg resolve -l |
|
264 | $ hg resolve -l | |
265 | $ hg status |
|
265 | $ hg status | |
266 | A foo/foo |
|
266 | A foo/foo | |
267 | ? a/a.orig |
|
267 | ? a/a.orig | |
268 |
|
268 | |||
269 | try to continue with no unshelve underway |
|
269 | try to continue with no unshelve underway | |
270 |
|
270 | |||
271 | $ hg unshelve -c |
|
271 | $ hg unshelve -c | |
272 | abort: no unshelve operation underway |
|
272 | abort: no unshelve operation underway | |
273 | [255] |
|
273 | [255] | |
274 | $ hg status |
|
274 | $ hg status | |
275 | A foo/foo |
|
275 | A foo/foo | |
276 | ? a/a.orig |
|
276 | ? a/a.orig | |
277 |
|
277 | |||
278 | redo the unshelve to get a conflict |
|
278 | redo the unshelve to get a conflict | |
279 |
|
279 | |||
280 | $ hg unshelve -q |
|
280 | $ hg unshelve -q | |
281 | warning: conflicts during merge. |
|
281 | warning: conflicts during merge. | |
282 | merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
282 | merging a/a incomplete! (edit conflicts, then use 'hg resolve --mark') | |
283 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
283 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') | |
284 | [1] |
|
284 | [1] | |
285 |
|
285 | |||
286 | attempt to continue |
|
286 | attempt to continue | |
287 |
|
287 | |||
288 | $ hg unshelve -c |
|
288 | $ hg unshelve -c | |
289 | abort: unresolved conflicts, can't continue |
|
289 | abort: unresolved conflicts, can't continue | |
290 | (see 'hg resolve', then 'hg unshelve --continue') |
|
290 | (see 'hg resolve', then 'hg unshelve --continue') | |
291 | [255] |
|
291 | [255] | |
292 |
|
292 | |||
293 | $ hg revert -r . a/a |
|
293 | $ hg revert -r . a/a | |
294 | $ hg resolve -m a/a |
|
294 | $ hg resolve -m a/a | |
295 |
|
295 | |||
296 | $ hg commit -m 'commit while unshelve in progress' |
|
296 | $ hg commit -m 'commit while unshelve in progress' | |
297 | abort: unshelve already in progress |
|
297 | abort: unshelve already in progress | |
298 | (use 'hg unshelve --continue' or 'hg unshelve --abort') |
|
298 | (use 'hg unshelve --continue' or 'hg unshelve --abort') | |
299 | [255] |
|
299 | [255] | |
300 |
|
300 | |||
301 | $ hg unshelve -c |
|
301 | $ hg unshelve -c | |
302 | unshelve of 'default' complete |
|
302 | unshelve of 'default' complete | |
303 |
|
303 | |||
304 | ensure the repo is as we hope |
|
304 | ensure the repo is as we hope | |
305 |
|
305 | |||
306 | $ hg parents |
|
306 | $ hg parents | |
307 | changeset: 3:2e69b451d1ea |
|
307 | changeset: 3:2e69b451d1ea | |
308 | tag: tip |
|
308 | tag: tip | |
309 | user: test |
|
309 | user: test | |
310 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
310 | date: Thu Jan 01 00:00:00 1970 +0000 | |
311 | summary: second |
|
311 | summary: second | |
312 |
|
312 | |||
313 | $ hg heads -q |
|
313 | $ hg heads -q | |
314 | 3:2e69b451d1ea |
|
314 | 3:2e69b451d1ea | |
315 |
|
315 | |||
316 | $ hg status -C |
|
316 | $ hg status -C | |
317 | A b.rename/b |
|
317 | A b.rename/b | |
318 | b/b |
|
318 | b/b | |
319 | A c.copy |
|
319 | A c.copy | |
320 | c |
|
320 | c | |
321 | A foo/foo |
|
321 | A foo/foo | |
322 | R b/b |
|
322 | R b/b | |
323 | ? a/a.orig |
|
323 | ? a/a.orig | |
324 |
|
324 | |||
325 | there should be no shelves left |
|
325 | there should be no shelves left | |
326 |
|
326 | |||
327 | $ hg shelve -l |
|
327 | $ hg shelve -l | |
328 |
|
328 | |||
329 | #if execbit |
|
329 | #if execbit | |
330 |
|
330 | |||
331 | ensure that metadata-only changes are shelved |
|
331 | ensure that metadata-only changes are shelved | |
332 |
|
332 | |||
333 | $ chmod +x a/a |
|
333 | $ chmod +x a/a | |
334 | $ hg shelve -q -n execbit a/a |
|
334 | $ hg shelve -q -n execbit a/a | |
335 | $ hg status a/a |
|
335 | $ hg status a/a | |
336 | $ hg unshelve -q execbit |
|
336 | $ hg unshelve -q execbit | |
337 | $ hg status a/a |
|
337 | $ hg status a/a | |
338 | M a/a |
|
338 | M a/a | |
339 | $ hg revert a/a |
|
339 | $ hg revert a/a | |
340 |
|
340 | |||
341 | #endif |
|
341 | #endif | |
342 |
|
342 | |||
343 | #if symlink |
|
343 | #if symlink | |
344 |
|
344 | |||
345 | $ rm a/a |
|
345 | $ rm a/a | |
346 | $ ln -s foo a/a |
|
346 | $ ln -s foo a/a | |
347 | $ hg shelve -q -n symlink a/a |
|
347 | $ hg shelve -q -n symlink a/a | |
348 | $ hg status a/a |
|
348 | $ hg status a/a | |
349 | $ hg unshelve -q symlink |
|
349 | $ hg unshelve -q symlink | |
350 | $ hg status a/a |
|
350 | $ hg status a/a | |
351 | M a/a |
|
351 | M a/a | |
352 | $ hg revert a/a |
|
352 | $ hg revert a/a | |
353 |
|
353 | |||
354 | #endif |
|
354 | #endif | |
355 |
|
355 | |||
356 | set up another conflict between a commit and a shelved change |
|
356 | set up another conflict between a commit and a shelved change | |
357 |
|
357 | |||
358 | $ hg revert -q -C -a |
|
358 | $ hg revert -q -C -a | |
359 | $ rm a/a.orig b.rename/b c.copy |
|
359 | $ rm a/a.orig b.rename/b c.copy | |
360 | $ echo a >> a/a |
|
360 | $ echo a >> a/a | |
361 | $ hg shelve -q |
|
361 | $ hg shelve -q | |
362 | $ echo x >> a/a |
|
362 | $ echo x >> a/a | |
363 | $ hg ci -m 'create conflict' |
|
363 | $ hg ci -m 'create conflict' | |
364 | $ hg add foo/foo |
|
364 | $ hg add foo/foo | |
365 |
|
365 | |||
366 | if we resolve a conflict while unshelving, the unshelve should succeed |
|
366 | if we resolve a conflict while unshelving, the unshelve should succeed | |
367 |
|
367 | |||
368 | $ HGMERGE=true hg unshelve |
|
368 | $ HGMERGE=true hg unshelve | |
369 | unshelving change 'default' |
|
369 | unshelving change 'default' | |
370 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
370 | temporarily committing pending changes (restore with 'hg unshelve --abort') | |
371 | rebasing shelved changes |
|
371 | rebasing shelved changes | |
372 | merging a/a |
|
372 | merging a/a | |
373 | $ hg parents -q |
|
373 | $ hg parents -q | |
374 | 4:33f7f61e6c5e |
|
374 | 4:33f7f61e6c5e | |
375 | $ hg shelve -l |
|
375 | $ hg shelve -l | |
376 | $ hg status |
|
376 | $ hg status | |
377 | A foo/foo |
|
377 | A foo/foo | |
378 | $ cat a/a |
|
378 | $ cat a/a | |
379 | a |
|
379 | a | |
380 | c |
|
380 | c | |
381 | x |
|
381 | x | |
382 |
|
382 | |||
383 | test keep and cleanup |
|
383 | test keep and cleanup | |
384 |
|
384 | |||
385 | $ hg shelve |
|
385 | $ hg shelve | |
386 | shelved as default |
|
386 | shelved as default | |
387 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
387 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
388 | $ hg shelve --list |
|
388 | $ hg shelve --list | |
389 | default (*) changes to 'create conflict' (glob) |
|
389 | default (*) changes to 'create conflict' (glob) | |
390 | $ hg unshelve --keep |
|
390 | $ hg unshelve --keep | |
391 | unshelving change 'default' |
|
391 | unshelving change 'default' | |
392 | $ hg shelve --list |
|
392 | $ hg shelve --list | |
393 | default (*) changes to 'create conflict' (glob) |
|
393 | default (*) changes to 'create conflict' (glob) | |
394 | $ hg shelve --cleanup |
|
394 | $ hg shelve --cleanup | |
395 | $ hg shelve --list |
|
395 | $ hg shelve --list | |
396 |
|
396 | |||
397 | test bookmarks |
|
397 | test bookmarks | |
398 |
|
398 | |||
399 | $ hg bookmark test |
|
399 | $ hg bookmark test | |
400 | $ hg bookmark |
|
400 | $ hg bookmark | |
401 | * test 4:33f7f61e6c5e |
|
401 | * test 4:33f7f61e6c5e | |
402 | $ hg shelve |
|
402 | $ hg shelve | |
403 | shelved as test |
|
403 | shelved as test | |
404 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
404 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
405 | $ hg bookmark |
|
405 | $ hg bookmark | |
406 | * test 4:33f7f61e6c5e |
|
406 | * test 4:33f7f61e6c5e | |
407 | $ hg unshelve |
|
407 | $ hg unshelve | |
408 | unshelving change 'test' |
|
408 | unshelving change 'test' | |
409 | $ hg bookmark |
|
409 | $ hg bookmark | |
410 | * test 4:33f7f61e6c5e |
|
410 | * test 4:33f7f61e6c5e | |
411 |
|
411 | |||
412 | shelve should still work even if mq is disabled |
|
412 | shelve should still work even if mq is disabled | |
413 |
|
413 | |||
414 | $ hg --config extensions.mq=! shelve |
|
414 | $ hg --config extensions.mq=! shelve | |
415 | shelved as test |
|
415 | shelved as test | |
416 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
416 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
417 | $ hg --config extensions.mq=! shelve --list |
|
417 | $ hg --config extensions.mq=! shelve --list | |
418 | test (*) changes to 'create conflict' (glob) |
|
418 | test (*) changes to 'create conflict' (glob) | |
419 | $ hg --config extensions.mq=! unshelve |
|
419 | $ hg --config extensions.mq=! unshelve | |
420 | unshelving change 'test' |
|
420 | unshelving change 'test' | |
421 |
|
421 | |||
422 | shelve should leave dirstate clean (issue 4055) |
|
422 | shelve should leave dirstate clean (issue 4055) | |
423 |
|
423 | |||
424 | $ cd .. |
|
424 | $ cd .. | |
425 | $ hg init shelverebase |
|
425 | $ hg init shelverebase | |
426 | $ cd shelverebase |
|
426 | $ cd shelverebase | |
427 | $ printf 'x\ny\n' > x |
|
427 | $ printf 'x\ny\n' > x | |
428 | $ echo z > z |
|
428 | $ echo z > z | |
429 | $ hg commit -Aqm xy |
|
429 | $ hg commit -Aqm xy | |
430 | $ echo z >> x |
|
430 | $ echo z >> x | |
431 | $ hg commit -Aqm z |
|
431 | $ hg commit -Aqm z | |
432 | $ hg up 0 |
|
432 | $ hg up 0 | |
433 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
433 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
434 | $ printf 'a\nx\ny\nz\n' > x |
|
434 | $ printf 'a\nx\ny\nz\n' > x | |
435 | $ hg commit -Aqm xyz |
|
435 | $ hg commit -Aqm xyz | |
436 | $ echo c >> z |
|
436 | $ echo c >> z | |
437 | $ hg shelve |
|
437 | $ hg shelve | |
438 | shelved as default |
|
438 | shelved as default | |
439 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
439 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
440 | $ hg rebase -d 1 --config extensions.rebase= |
|
440 | $ hg rebase -d 1 --config extensions.rebase= | |
441 | merging x |
|
441 | merging x | |
442 | saved backup bundle to $TESTTMP/shelverebase/.hg/strip-backup/323bfa07f744-backup.hg (glob) |
|
442 | saved backup bundle to $TESTTMP/shelverebase/.hg/strip-backup/323bfa07f744-backup.hg (glob) | |
443 | $ hg unshelve |
|
443 | $ hg unshelve | |
444 | unshelving change 'default' |
|
444 | unshelving change 'default' | |
445 | rebasing shelved changes |
|
445 | rebasing shelved changes | |
446 | $ hg status |
|
446 | $ hg status | |
447 | M z |
|
447 | M z | |
448 |
|
448 | |||
449 | $ cd .. |
|
449 | $ cd .. | |
450 |
|
450 | |||
451 | shelve should only unshelve pending changes (issue 4068) |
|
451 | shelve should only unshelve pending changes (issue 4068) | |
452 |
|
452 | |||
453 | $ hg init onlypendingchanges |
|
453 | $ hg init onlypendingchanges | |
454 | $ cd onlypendingchanges |
|
454 | $ cd onlypendingchanges | |
455 | $ touch a |
|
455 | $ touch a | |
456 | $ hg ci -Aqm a |
|
456 | $ hg ci -Aqm a | |
457 | $ touch b |
|
457 | $ touch b | |
458 | $ hg ci -Aqm b |
|
458 | $ hg ci -Aqm b | |
459 | $ hg up -q 0 |
|
459 | $ hg up -q 0 | |
460 | $ touch c |
|
460 | $ touch c | |
461 | $ hg ci -Aqm c |
|
461 | $ hg ci -Aqm c | |
462 |
|
462 | |||
463 | $ touch d |
|
463 | $ touch d | |
464 | $ hg add d |
|
464 | $ hg add d | |
465 | $ hg shelve |
|
465 | $ hg shelve | |
466 | shelved as default |
|
466 | shelved as default | |
467 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
467 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
468 | $ hg up -q 1 |
|
468 | $ hg up -q 1 | |
469 | $ hg unshelve |
|
469 | $ hg unshelve | |
470 | unshelving change 'default' |
|
470 | unshelving change 'default' | |
471 | rebasing shelved changes |
|
471 | rebasing shelved changes | |
472 | $ hg status |
|
472 | $ hg status | |
473 | A d |
|
473 | A d | |
474 |
|
474 | |||
475 | unshelve should work on an ancestor of the original commit |
|
475 | unshelve should work on an ancestor of the original commit | |
476 |
|
476 | |||
477 | $ hg shelve |
|
477 | $ hg shelve | |
478 | shelved as default |
|
478 | shelved as default | |
479 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
479 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
480 | $ hg up 0 |
|
480 | $ hg up 0 | |
481 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
481 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
482 | $ hg unshelve |
|
482 | $ hg unshelve | |
483 | unshelving change 'default' |
|
483 | unshelving change 'default' | |
484 | rebasing shelved changes |
|
484 | rebasing shelved changes | |
485 | $ hg status |
|
485 | $ hg status | |
486 | A d |
|
486 | A d | |
487 |
|
487 | |||
488 | test bug 4073 we need to enable obsolete markers for it |
|
488 | test bug 4073 we need to enable obsolete markers for it | |
489 |
|
489 | |||
490 | $ cat > ../obs.py << EOF |
|
490 | $ cat > ../obs.py << EOF | |
491 | > import mercurial.obsolete |
|
491 | > import mercurial.obsolete | |
492 | > mercurial.obsolete._enabled = True |
|
492 | > mercurial.obsolete._enabled = True | |
493 | > EOF |
|
493 | > EOF | |
494 | $ echo '[extensions]' >> $HGRCPATH |
|
494 | $ echo '[extensions]' >> $HGRCPATH | |
495 | $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH |
|
495 | $ echo "obs=${TESTTMP}/obs.py" >> $HGRCPATH | |
496 | $ hg shelve |
|
496 | $ hg shelve | |
497 | shelved as default |
|
497 | shelved as default | |
498 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
498 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
499 | $ hg debugobsolete `hg --debug id -i -r 1` |
|
499 | $ hg debugobsolete `hg --debug id -i -r 1` | |
500 | $ hg unshelve |
|
500 | $ hg unshelve | |
501 | unshelving change 'default' |
|
501 | unshelving change 'default' | |
502 |
|
502 | |||
503 | unshelve should leave unknown files alone (issue4113) |
|
503 | unshelve should leave unknown files alone (issue4113) | |
504 |
|
504 | |||
505 | $ echo e > e |
|
505 | $ echo e > e | |
506 | $ hg shelve |
|
506 | $ hg shelve | |
507 | shelved as default |
|
507 | shelved as default | |
508 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
508 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
509 | $ hg status |
|
509 | $ hg status | |
510 | ? e |
|
510 | ? e | |
511 | $ hg unshelve |
|
511 | $ hg unshelve | |
512 | unshelving change 'default' |
|
512 | unshelving change 'default' | |
513 | $ hg status |
|
513 | $ hg status | |
514 | A d |
|
514 | A d | |
515 | ? e |
|
515 | ? e | |
516 | $ cat e |
|
516 | $ cat e | |
517 | e |
|
517 | e | |
518 |
|
518 | |||
519 | unshelve should keep a copy of unknown files |
|
519 | unshelve should keep a copy of unknown files | |
520 |
|
520 | |||
521 | $ hg add e |
|
521 | $ hg add e | |
522 | $ hg shelve |
|
522 | $ hg shelve | |
523 | shelved as default |
|
523 | shelved as default | |
524 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
524 | 0 files updated, 0 files merged, 2 files removed, 0 files unresolved | |
525 | $ echo z > e |
|
525 | $ echo z > e | |
526 | $ hg unshelve |
|
526 | $ hg unshelve | |
527 | unshelving change 'default' |
|
527 | unshelving change 'default' | |
528 | $ cat e |
|
528 | $ cat e | |
529 | e |
|
529 | e | |
530 | $ cat e.orig |
|
530 | $ cat e.orig | |
531 | z |
|
531 | z | |
532 |
|
532 | |||
533 |
|
533 | |||
534 | unshelve and conflicts with untracked files |
|
534 | unshelve and conflicts with tracked and untracked files | |
535 |
|
535 | |||
536 | preparing: |
|
536 | preparing: | |
537 |
|
537 | |||
538 | $ rm *.orig |
|
538 | $ rm *.orig | |
539 | $ hg ci -qm 'commit stuff' |
|
539 | $ hg ci -qm 'commit stuff' | |
540 | $ hg phase -p null: |
|
540 | $ hg phase -p null: | |
541 |
|
541 | |||
542 | no other changes - no merge: |
|
542 | no other changes - no merge: | |
543 |
|
543 | |||
544 | $ echo f > f |
|
544 | $ echo f > f | |
545 | $ hg add f |
|
545 | $ hg add f | |
546 | $ hg shelve |
|
546 | $ hg shelve | |
547 | shelved as default |
|
547 | shelved as default | |
548 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
548 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
549 |
$ echo g |
|
549 | $ echo g > f | |
550 | $ hg unshelve |
|
550 | $ hg unshelve | |
551 | unshelving change 'default' |
|
551 | unshelving change 'default' | |
552 | $ hg st |
|
552 | $ hg st | |
553 | A f |
|
553 | A f | |
554 | ? f.orig |
|
554 | ? f.orig | |
555 | $ cat f |
|
555 | $ cat f | |
556 | f |
|
556 | f | |
557 | $ cat f.orig |
|
557 | $ cat f.orig | |
558 |
g |
|
558 | g | |
559 |
|
559 | |||
560 | other uncommitted changes - merge: |
|
560 | other uncommitted changes - merge: | |
561 |
|
561 | |||
562 | $ hg st |
|
562 | $ hg st | |
563 | A f |
|
563 | A f | |
564 | ? f.orig |
|
564 | ? f.orig | |
565 | $ hg shelve |
|
565 | $ hg shelve | |
566 | shelved as default |
|
566 | shelved as default | |
567 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
567 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
568 | $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()' |
|
568 | $ hg log -G --template '{rev} {desc|firstline} {author}' -R bundle://.hg/shelved/default.hg -r 'bundle()' | |
569 | o 4 changes to 'commit stuff' shelve@localhost |
|
569 | o 4 changes to 'commit stuff' shelve@localhost | |
570 | | |
|
570 | | | |
571 | $ hg log -G --template '{rev} {desc|firstline} {author}' |
|
571 | $ hg log -G --template '{rev} {desc|firstline} {author}' | |
572 | @ 3 commit stuff test |
|
572 | @ 3 commit stuff test | |
573 | | |
|
573 | | | |
574 | | o 2 c test |
|
574 | | o 2 c test | |
575 | |/ |
|
575 | |/ | |
576 | o 0 a test |
|
576 | o 0 a test | |
577 |
|
577 | |||
578 | $ mv f.orig f |
|
578 | $ mv f.orig f | |
579 |
$ echo |
|
579 | $ echo 1 > a | |
580 | $ hg unshelve --date '1073741824 0' |
|
580 | $ hg unshelve --date '1073741824 0' | |
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 f |
|
584 | merging f | |
585 | warning: conflicts during merge. |
|
585 | warning: conflicts during merge. | |
586 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
586 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') | |
587 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
587 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') | |
588 | [1] |
|
588 | [1] | |
589 | $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}' |
|
589 | $ hg log -G --template '{rev} {desc|firstline} {author} {date|isodate}' | |
590 | @ 5 changes to 'commit stuff' shelve@localhost 1970-01-01 00:00 +0000 |
|
590 | @ 5 changes to 'commit stuff' shelve@localhost 1970-01-01 00:00 +0000 | |
591 | | |
|
591 | | | |
592 | | @ 4 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000 |
|
592 | | @ 4 pending changes temporary commit shelve@localhost 2004-01-10 13:37 +0000 | |
593 | |/ |
|
593 | |/ | |
594 | o 3 commit stuff test 1970-01-01 00:00 +0000 |
|
594 | o 3 commit stuff test 1970-01-01 00:00 +0000 | |
595 | | |
|
595 | | | |
596 | | o 2 c test 1970-01-01 00:00 +0000 |
|
596 | | o 2 c test 1970-01-01 00:00 +0000 | |
597 | |/ |
|
597 | |/ | |
598 | o 0 a test 1970-01-01 00:00 +0000 |
|
598 | o 0 a test 1970-01-01 00:00 +0000 | |
599 |
|
599 | |||
600 | $ hg st |
|
600 | $ hg st | |
601 | M f |
|
601 | M f | |
602 | ? f.orig |
|
602 | ? f.orig | |
603 | $ cat f |
|
603 | $ cat f | |
604 | <<<<<<< local |
|
604 | <<<<<<< local | |
605 |
g |
|
605 | g | |
606 | ======= |
|
606 | ======= | |
607 | f |
|
607 | f | |
608 | >>>>>>> other |
|
608 | >>>>>>> other | |
609 | $ cat f.orig |
|
609 | $ cat f.orig | |
610 |
g |
|
610 | g | |
611 | $ hg unshelve --abort |
|
611 | $ hg unshelve --abort | |
612 | rebase aborted |
|
612 | rebase aborted | |
613 | unshelve of 'default' aborted |
|
613 | unshelve of 'default' aborted | |
614 | $ hg st |
|
614 | $ hg st | |
615 | M a |
|
615 | M a | |
616 | ? f.orig |
|
616 | ? f.orig | |
617 | $ cat f.orig |
|
617 | $ cat f.orig | |
618 |
g |
|
618 | g | |
619 | $ hg unshelve |
|
619 | $ hg unshelve | |
620 | unshelving change 'default' |
|
620 | unshelving change 'default' | |
621 | temporarily committing pending changes (restore with 'hg unshelve --abort') |
|
621 | temporarily committing pending changes (restore with 'hg unshelve --abort') | |
622 | rebasing shelved changes |
|
622 | rebasing shelved changes | |
623 | $ hg st |
|
623 | $ hg st | |
624 | M a |
|
624 | M a | |
625 | A f |
|
625 | A f | |
626 | ? f.orig |
|
626 | ? f.orig | |
627 |
|
627 | |||
628 | other committed changes - merge: |
|
628 | other committed changes - merge: | |
629 |
|
629 | |||
630 | $ hg shelve f |
|
630 | $ hg shelve f | |
631 | shelved as default |
|
631 | shelved as default | |
632 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
632 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
633 | $ hg ci a -m 'intermediate other change' |
|
633 | $ hg ci a -m 'intermediate other change' | |
634 | $ mv f.orig f |
|
634 | $ mv f.orig f | |
635 | $ hg unshelve |
|
635 | $ hg unshelve | |
636 | unshelving change 'default' |
|
636 | unshelving change 'default' | |
637 | rebasing shelved changes |
|
637 | rebasing shelved changes | |
638 | merging f |
|
638 | merging f | |
639 | warning: conflicts during merge. |
|
639 | warning: conflicts during merge. | |
640 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') |
|
640 | merging f incomplete! (edit conflicts, then use 'hg resolve --mark') | |
641 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') |
|
641 | unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue') | |
642 | [1] |
|
642 | [1] | |
643 | $ hg st |
|
643 | $ hg st | |
644 | M f |
|
644 | M f | |
645 | ? f.orig |
|
645 | ? f.orig | |
646 | $ cat f |
|
646 | $ cat f | |
647 | <<<<<<< local |
|
647 | <<<<<<< local | |
648 |
g |
|
648 | g | |
649 | ======= |
|
649 | ======= | |
650 | f |
|
650 | f | |
651 | >>>>>>> other |
|
651 | >>>>>>> other | |
652 | $ cat f.orig |
|
652 | $ cat f.orig | |
653 |
g |
|
653 | g | |
654 | $ hg unshelve --abort |
|
654 | $ hg unshelve --abort | |
655 | rebase aborted |
|
655 | rebase aborted | |
656 | no changes needed to a |
|
656 | no changes needed to a | |
657 | no changes needed to d |
|
657 | no changes needed to d | |
658 | no changes needed to e |
|
658 | no changes needed to e | |
659 | unshelve of 'default' aborted |
|
659 | unshelve of 'default' aborted | |
|
660 | $ hg st | |||
|
661 | ? f.orig | |||
|
662 | $ cat f.orig | |||
|
663 | g | |||
660 | $ hg shelve --delete default |
|
664 | $ hg shelve --delete default | |
661 |
|
665 | |||
662 | $ cd .. |
|
666 | $ cd .. |
General Comments 0
You need to be logged in to leave comments.
Login now