Show More
@@ -1,1510 +1,1510 | |||
|
1 | 1 | $ "$TESTDIR/hghave" execbit || exit 80 |
|
2 | 2 | |
|
3 | 3 | $ checkundo() |
|
4 | 4 | > { |
|
5 | 5 | > if [ -f .hg/store/undo ]; then |
|
6 | 6 | > echo ".hg/store/undo still exists after $1" |
|
7 | 7 | > fi |
|
8 | 8 | > } |
|
9 | 9 | |
|
10 | 10 | $ echo "[extensions]" >> $HGRCPATH |
|
11 | 11 | $ echo "mq=" >> $HGRCPATH |
|
12 | 12 | |
|
13 | 13 | $ echo "[mq]" >> $HGRCPATH |
|
14 | 14 | $ echo "plain=true" >> $HGRCPATH |
|
15 | 15 | |
|
16 | 16 | |
|
17 | 17 | help |
|
18 | 18 | |
|
19 | 19 | $ hg help mq |
|
20 | 20 | mq extension - manage a stack of patches |
|
21 | 21 | |
|
22 | 22 | This extension lets you work with a stack of patches in a Mercurial |
|
23 | 23 | repository. It manages two stacks of patches - all known patches, and applied |
|
24 | 24 | patches (subset of known patches). |
|
25 | 25 | |
|
26 | 26 | Known patches are represented as patch files in the .hg/patches directory. |
|
27 | 27 | Applied patches are both patch files and changesets. |
|
28 | 28 | |
|
29 | 29 | Common tasks (use "hg help command" for more details): |
|
30 | 30 | |
|
31 | 31 | create new patch qnew |
|
32 | 32 | import existing patch qimport |
|
33 | 33 | |
|
34 | 34 | print patch series qseries |
|
35 | 35 | print applied patches qapplied |
|
36 | 36 | |
|
37 | 37 | add known patch to applied stack qpush |
|
38 | 38 | remove patch from applied stack qpop |
|
39 | 39 | refresh contents of top applied patch qrefresh |
|
40 | 40 | |
|
41 | 41 | By default, mq will automatically use git patches when required to avoid |
|
42 | 42 | losing file mode changes, copy records, binary files or empty files creations |
|
43 | 43 | or deletions. This behaviour can be configured with: |
|
44 | 44 | |
|
45 | 45 | [mq] |
|
46 | 46 | git = auto/keep/yes/no |
|
47 | 47 | |
|
48 | 48 | If set to 'keep', mq will obey the [diff] section configuration while |
|
49 | 49 | preserving existing git patches upon qrefresh. If set to 'yes' or 'no', mq |
|
50 | 50 | will override the [diff] section and always generate git or regular patches, |
|
51 | 51 | possibly losing data in the second case. |
|
52 | 52 | |
|
53 | 53 | It may be desirable for mq changesets to be kept in the secret phase (see "hg |
|
54 | 54 | help phases"), which can be enabled with the following setting: |
|
55 | 55 | |
|
56 | 56 | [mq] |
|
57 | 57 | secret = True |
|
58 | 58 | |
|
59 | 59 | You will by default be managing a patch queue named "patches". You can create |
|
60 | 60 | other, independent patch queues with the "hg qqueue" command. |
|
61 | 61 | |
|
62 | 62 | list of commands: |
|
63 | 63 | |
|
64 | 64 | qapplied print the patches already applied |
|
65 | 65 | qclone clone main and patch repository at same time |
|
66 | 66 | qdelete remove patches from queue |
|
67 | 67 | qdiff diff of the current patch and subsequent modifications |
|
68 | 68 | qfinish move applied patches into repository history |
|
69 | 69 | qfold fold the named patches into the current patch |
|
70 | 70 | qgoto push or pop patches until named patch is at top of stack |
|
71 | 71 | qguard set or print guards for a patch |
|
72 | 72 | qheader print the header of the topmost or specified patch |
|
73 | 73 | qimport import a patch |
|
74 | 74 | qnew create a new patch |
|
75 | 75 | qnext print the name of the next pushable patch |
|
76 | 76 | qpop pop the current patch off the stack |
|
77 | 77 | qprev print the name of the preceding applied patch |
|
78 | 78 | qpush push the next patch onto the stack |
|
79 | 79 | qqueue manage multiple patch queues |
|
80 | 80 | qrefresh update the current patch |
|
81 | 81 | qrename rename a patch |
|
82 | 82 | qselect set or print guarded patches to push |
|
83 | 83 | qseries print the entire series file |
|
84 | 84 | qtop print the name of the current patch |
|
85 | 85 | qunapplied print the patches not yet applied |
|
86 | 86 | strip strip changesets and all their descendants from the repository |
|
87 | 87 | |
|
88 | 88 | use "hg -v help mq" to show builtin aliases and global options |
|
89 | 89 | |
|
90 | 90 | $ hg init a |
|
91 | 91 | $ cd a |
|
92 | 92 | $ echo a > a |
|
93 | 93 | $ hg ci -Ama |
|
94 | 94 | adding a |
|
95 | 95 | |
|
96 | 96 | $ hg clone . ../k |
|
97 | 97 | updating to branch default |
|
98 | 98 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
99 | 99 | |
|
100 | 100 | $ mkdir b |
|
101 | 101 | $ echo z > b/z |
|
102 | 102 | $ hg ci -Ama |
|
103 | 103 | adding b/z |
|
104 | 104 | |
|
105 | 105 | |
|
106 | 106 | qinit |
|
107 | 107 | |
|
108 | 108 | $ hg qinit |
|
109 | 109 | |
|
110 | 110 | $ cd .. |
|
111 | 111 | $ hg init b |
|
112 | 112 | |
|
113 | 113 | |
|
114 | 114 | -R qinit |
|
115 | 115 | |
|
116 | 116 | $ hg -R b qinit |
|
117 | 117 | |
|
118 | 118 | $ hg init c |
|
119 | 119 | |
|
120 | 120 | |
|
121 | 121 | qinit -c |
|
122 | 122 | |
|
123 | 123 | $ hg --cwd c qinit -c |
|
124 | 124 | $ hg -R c/.hg/patches st |
|
125 | 125 | A .hgignore |
|
126 | 126 | A series |
|
127 | 127 | |
|
128 | 128 | |
|
129 | 129 | qinit; qinit -c |
|
130 | 130 | |
|
131 | 131 | $ hg init d |
|
132 | 132 | $ cd d |
|
133 | 133 | $ hg qinit |
|
134 | 134 | $ hg qinit -c |
|
135 | 135 | |
|
136 | 136 | qinit -c should create both files if they don't exist |
|
137 | 137 | |
|
138 | 138 | $ cat .hg/patches/.hgignore |
|
139 | 139 | ^\.hg |
|
140 | 140 | ^\.mq |
|
141 | 141 | syntax: glob |
|
142 | 142 | status |
|
143 | 143 | guards |
|
144 | 144 | $ cat .hg/patches/series |
|
145 | 145 | $ hg qinit -c |
|
146 | 146 | abort: repository $TESTTMP/d/.hg/patches already exists! (glob) |
|
147 | 147 | [255] |
|
148 | 148 | $ cd .. |
|
149 | 149 | |
|
150 | 150 | $ echo '% qinit; <stuff>; qinit -c' |
|
151 | 151 | % qinit; <stuff>; qinit -c |
|
152 | 152 | $ hg init e |
|
153 | 153 | $ cd e |
|
154 | 154 | $ hg qnew A |
|
155 | 155 | $ checkundo qnew |
|
156 | 156 | $ echo foo > foo |
|
157 | 157 | $ hg phase -r qbase |
|
158 | 158 | 0: draft |
|
159 | 159 | $ hg add foo |
|
160 | 160 | $ hg qrefresh |
|
161 | 161 | $ hg phase -r qbase |
|
162 | 162 | 0: draft |
|
163 | 163 | $ hg qnew B |
|
164 | 164 | $ echo >> foo |
|
165 | 165 | $ hg qrefresh |
|
166 | 166 | $ echo status >> .hg/patches/.hgignore |
|
167 | 167 | $ echo bleh >> .hg/patches/.hgignore |
|
168 | 168 | $ hg qinit -c |
|
169 | 169 | adding .hg/patches/A (glob) |
|
170 | 170 | adding .hg/patches/B (glob) |
|
171 | 171 | $ hg -R .hg/patches status |
|
172 | 172 | A .hgignore |
|
173 | 173 | A A |
|
174 | 174 | A B |
|
175 | 175 | A series |
|
176 | 176 | |
|
177 | 177 | qinit -c shouldn't touch these files if they already exist |
|
178 | 178 | |
|
179 | 179 | $ cat .hg/patches/.hgignore |
|
180 | 180 | status |
|
181 | 181 | bleh |
|
182 | 182 | $ cat .hg/patches/series |
|
183 | 183 | A |
|
184 | 184 | B |
|
185 | 185 | |
|
186 | 186 | add an untracked file |
|
187 | 187 | |
|
188 | 188 | $ echo >> .hg/patches/flaf |
|
189 | 189 | |
|
190 | 190 | status --mq with color (issue2096) |
|
191 | 191 | |
|
192 | 192 | $ hg status --mq --config extensions.color= --config color.mode=ansi --color=always |
|
193 | 193 | \x1b[0;32;1mA .hgignore\x1b[0m (esc) |
|
194 | 194 | \x1b[0;32;1mA A\x1b[0m (esc) |
|
195 | 195 | \x1b[0;32;1mA B\x1b[0m (esc) |
|
196 | 196 | \x1b[0;32;1mA series\x1b[0m (esc) |
|
197 | 197 | \x1b[0;35;1;4m? flaf\x1b[0m (esc) |
|
198 | 198 | |
|
199 | 199 | try the --mq option on a command provided by an extension |
|
200 | 200 | |
|
201 | 201 | $ hg purge --mq --verbose --config extensions.purge= |
|
202 | 202 | Removing file flaf |
|
203 | 203 | |
|
204 | 204 | $ cd .. |
|
205 | 205 | |
|
206 | 206 | init --mq without repo |
|
207 | 207 | |
|
208 | 208 | $ mkdir f |
|
209 | 209 | $ cd f |
|
210 | 210 | $ hg init --mq |
|
211 | 211 | abort: there is no Mercurial repository here (.hg not found) |
|
212 | 212 | [255] |
|
213 | 213 | $ cd .. |
|
214 | 214 | |
|
215 | 215 | init --mq with repo path |
|
216 | 216 | |
|
217 | 217 | $ hg init g |
|
218 | 218 | $ hg init --mq g |
|
219 | 219 | $ test -d g/.hg/patches/.hg |
|
220 | 220 | |
|
221 | 221 | init --mq with nonexistent directory |
|
222 | 222 | |
|
223 | 223 | $ hg init --mq nonexistentdir |
|
224 | 224 | abort: repository nonexistentdir not found! |
|
225 | 225 | [255] |
|
226 | 226 | |
|
227 | 227 | |
|
228 | 228 | init --mq with bundle (non "local") |
|
229 | 229 | |
|
230 | 230 | $ hg -R a bundle --all a.bundle >/dev/null |
|
231 | 231 | $ hg init --mq a.bundle |
|
232 | 232 | abort: only a local queue repository may be initialized |
|
233 | 233 | [255] |
|
234 | 234 | |
|
235 | 235 | $ cd a |
|
236 | 236 | |
|
237 | 237 | $ hg qnew -m 'foo bar' test.patch |
|
238 | 238 | |
|
239 | 239 | $ echo '# comment' > .hg/patches/series.tmp |
|
240 | 240 | $ echo >> .hg/patches/series.tmp # empty line |
|
241 | 241 | $ cat .hg/patches/series >> .hg/patches/series.tmp |
|
242 | 242 | $ mv .hg/patches/series.tmp .hg/patches/series |
|
243 | 243 | |
|
244 | 244 | |
|
245 | 245 | qrefresh |
|
246 | 246 | |
|
247 | 247 | $ echo a >> a |
|
248 | 248 | $ hg qrefresh |
|
249 | 249 | $ cat .hg/patches/test.patch |
|
250 | 250 | foo bar |
|
251 | 251 | |
|
252 | 252 | diff -r [a-f0-9]* a (re) |
|
253 | 253 | --- a/a\t(?P<date>.*) (re) |
|
254 | 254 | \+\+\+ b/a\t(?P<date2>.*) (re) |
|
255 | 255 | @@ -1,1 +1,2 @@ |
|
256 | 256 | a |
|
257 | 257 | +a |
|
258 | 258 | |
|
259 | 259 | empty qrefresh |
|
260 | 260 | |
|
261 | 261 | $ hg qrefresh -X a |
|
262 | 262 | |
|
263 | 263 | revision: |
|
264 | 264 | |
|
265 | 265 | $ hg diff -r -2 -r -1 |
|
266 | 266 | |
|
267 | 267 | patch: |
|
268 | 268 | |
|
269 | 269 | $ cat .hg/patches/test.patch |
|
270 | 270 | foo bar |
|
271 | 271 | |
|
272 | 272 | |
|
273 | 273 | working dir diff: |
|
274 | 274 | |
|
275 | 275 | $ hg diff --nodates -q |
|
276 | 276 | --- a/a |
|
277 | 277 | +++ b/a |
|
278 | 278 | @@ -1,1 +1,2 @@ |
|
279 | 279 | a |
|
280 | 280 | +a |
|
281 | 281 | |
|
282 | 282 | restore things |
|
283 | 283 | |
|
284 | 284 | $ hg qrefresh |
|
285 | 285 | $ checkundo qrefresh |
|
286 | 286 | |
|
287 | 287 | |
|
288 | 288 | qpop |
|
289 | 289 | |
|
290 | 290 | $ hg qpop |
|
291 | 291 | popping test.patch |
|
292 | 292 | patch queue now empty |
|
293 | 293 | $ checkundo qpop |
|
294 | 294 | |
|
295 | 295 | |
|
296 | 296 | qpush with dump of tag cache |
|
297 | 297 | Dump the tag cache to ensure that it has exactly one head after qpush. |
|
298 | 298 | |
|
299 | 299 | $ rm -f .hg/cache/tags |
|
300 | 300 | $ hg tags > /dev/null |
|
301 | 301 | |
|
302 | 302 | .hg/cache/tags (pre qpush): |
|
303 | 303 | |
|
304 | 304 | $ cat .hg/cache/tags |
|
305 | 305 | 1 [\da-f]{40} (re) |
|
306 | 306 | |
|
307 | 307 | $ hg qpush |
|
308 | 308 | applying test.patch |
|
309 | 309 | now at: test.patch |
|
310 | 310 | $ hg phase -r qbase |
|
311 | 311 | 2: draft |
|
312 | 312 | $ hg tags > /dev/null |
|
313 | 313 | |
|
314 | 314 | .hg/cache/tags (post qpush): |
|
315 | 315 | |
|
316 | 316 | $ cat .hg/cache/tags |
|
317 | 317 | 2 [\da-f]{40} (re) |
|
318 | 318 | |
|
319 | 319 | $ checkundo qpush |
|
320 | 320 | $ cd .. |
|
321 | 321 | |
|
322 | 322 | |
|
323 | 323 | pop/push outside repo |
|
324 | 324 | $ hg -R a qpop |
|
325 | 325 | popping test.patch |
|
326 | 326 | patch queue now empty |
|
327 | 327 | $ hg -R a qpush |
|
328 | 328 | applying test.patch |
|
329 | 329 | now at: test.patch |
|
330 | 330 | |
|
331 | 331 | $ cd a |
|
332 | 332 | $ hg qnew test2.patch |
|
333 | 333 | |
|
334 | 334 | qrefresh in subdir |
|
335 | 335 | |
|
336 | 336 | $ cd b |
|
337 | 337 | $ echo a > a |
|
338 | 338 | $ hg add a |
|
339 | 339 | $ hg qrefresh |
|
340 | 340 | |
|
341 | 341 | pop/push -a in subdir |
|
342 | 342 | |
|
343 | 343 | $ hg qpop -a |
|
344 | 344 | popping test2.patch |
|
345 | 345 | popping test.patch |
|
346 | 346 | patch queue now empty |
|
347 | 347 | $ hg --traceback qpush -a |
|
348 | 348 | applying test.patch |
|
349 | 349 | applying test2.patch |
|
350 | 350 | now at: test2.patch |
|
351 | 351 | |
|
352 | 352 | |
|
353 | 353 | setting columns & formatted tests truncating (issue1912) |
|
354 | 354 | |
|
355 | 355 | $ COLUMNS=4 hg qseries --config ui.formatted=true |
|
356 | 356 | test.patch |
|
357 | 357 | test2.patch |
|
358 | 358 | $ COLUMNS=20 hg qseries --config ui.formatted=true -vs |
|
359 | 359 | 0 A test.patch: f... |
|
360 | 360 | 1 A test2.patch: |
|
361 | 361 | $ hg qpop |
|
362 | 362 | popping test2.patch |
|
363 | 363 | now at: test.patch |
|
364 | 364 | $ hg qseries -vs |
|
365 | 365 | 0 A test.patch: foo bar |
|
366 | 366 | 1 U test2.patch: |
|
367 | 367 | $ hg sum | grep mq |
|
368 | 368 | mq: 1 applied, 1 unapplied |
|
369 | 369 | $ hg qpush |
|
370 | 370 | applying test2.patch |
|
371 | 371 | now at: test2.patch |
|
372 | 372 | $ hg sum | grep mq |
|
373 | 373 | mq: 2 applied |
|
374 | 374 | $ hg qapplied |
|
375 | 375 | test.patch |
|
376 | 376 | test2.patch |
|
377 | 377 | $ hg qtop |
|
378 | 378 | test2.patch |
|
379 | 379 | |
|
380 | 380 | |
|
381 | 381 | prev |
|
382 | 382 | |
|
383 | 383 | $ hg qapp -1 |
|
384 | 384 | test.patch |
|
385 | 385 | |
|
386 | 386 | next |
|
387 | 387 | |
|
388 | 388 | $ hg qunapp -1 |
|
389 | 389 | all patches applied |
|
390 | 390 | [1] |
|
391 | 391 | |
|
392 | 392 | $ hg qpop |
|
393 | 393 | popping test2.patch |
|
394 | 394 | now at: test.patch |
|
395 | 395 | |
|
396 | 396 | commit should fail |
|
397 | 397 | |
|
398 | 398 | $ hg commit |
|
399 | 399 | abort: cannot commit over an applied mq patch |
|
400 | 400 | [255] |
|
401 | 401 | |
|
402 | 402 | push should fail if draft |
|
403 | 403 | |
|
404 | 404 | $ hg push ../../k |
|
405 | 405 | pushing to ../../k |
|
406 | 406 | abort: source has mq patches applied |
|
407 | 407 | [255] |
|
408 | 408 | |
|
409 | 409 | |
|
410 | 410 | import should fail |
|
411 | 411 | |
|
412 | 412 | $ hg st . |
|
413 | 413 | $ echo foo >> ../a |
|
414 | 414 | $ hg diff > ../../import.diff |
|
415 | 415 | $ hg revert --no-backup ../a |
|
416 | 416 | $ hg import ../../import.diff |
|
417 | 417 | abort: cannot import over an applied patch |
|
418 | 418 | [255] |
|
419 | 419 | $ hg st |
|
420 | 420 | |
|
421 | 421 | import --no-commit should succeed |
|
422 | 422 | |
|
423 | 423 | $ hg import --no-commit ../../import.diff |
|
424 | 424 | applying ../../import.diff |
|
425 | 425 | $ hg st |
|
426 | 426 | M a |
|
427 | 427 | $ hg revert --no-backup ../a |
|
428 | 428 | |
|
429 | 429 | |
|
430 | 430 | qunapplied |
|
431 | 431 | |
|
432 | 432 | $ hg qunapplied |
|
433 | 433 | test2.patch |
|
434 | 434 | |
|
435 | 435 | |
|
436 | 436 | qpush/qpop with index |
|
437 | 437 | |
|
438 | 438 | $ hg qnew test1b.patch |
|
439 | 439 | $ echo 1b > 1b |
|
440 | 440 | $ hg add 1b |
|
441 | 441 | $ hg qrefresh |
|
442 | 442 | $ hg qpush 2 |
|
443 | 443 | applying test2.patch |
|
444 | 444 | now at: test2.patch |
|
445 | 445 | $ hg qpop 0 |
|
446 | 446 | popping test2.patch |
|
447 | 447 | popping test1b.patch |
|
448 | 448 | now at: test.patch |
|
449 | 449 | $ hg qpush test.patch+1 |
|
450 | 450 | applying test1b.patch |
|
451 | 451 | now at: test1b.patch |
|
452 | 452 | $ hg qpush test.patch+2 |
|
453 | 453 | applying test2.patch |
|
454 | 454 | now at: test2.patch |
|
455 | 455 | $ hg qpop test2.patch-1 |
|
456 | 456 | popping test2.patch |
|
457 | 457 | now at: test1b.patch |
|
458 | 458 | $ hg qpop test2.patch-2 |
|
459 | 459 | popping test1b.patch |
|
460 | 460 | now at: test.patch |
|
461 | 461 | $ hg qpush test1b.patch+1 |
|
462 | 462 | applying test1b.patch |
|
463 | 463 | applying test2.patch |
|
464 | 464 | now at: test2.patch |
|
465 | 465 | |
|
466 | 466 | |
|
467 | 467 | qpush --move |
|
468 | 468 | |
|
469 | 469 | $ hg qpop -a |
|
470 | 470 | popping test2.patch |
|
471 | 471 | popping test1b.patch |
|
472 | 472 | popping test.patch |
|
473 | 473 | patch queue now empty |
|
474 | 474 | $ hg qguard test1b.patch -- -negguard |
|
475 | 475 | $ hg qguard test2.patch -- +posguard |
|
476 | 476 | $ hg qpush --move test2.patch # can't move guarded patch |
|
477 | 477 | cannot push 'test2.patch' - guarded by '+posguard' |
|
478 | 478 | [1] |
|
479 | 479 | $ hg qselect posguard |
|
480 | 480 | number of unguarded, unapplied patches has changed from 2 to 3 |
|
481 | 481 | $ hg qpush --move test2.patch # move to front |
|
482 | 482 | applying test2.patch |
|
483 | 483 | now at: test2.patch |
|
484 | 484 | $ hg qpush --move test1b.patch # negative guard unselected |
|
485 | 485 | applying test1b.patch |
|
486 | 486 | now at: test1b.patch |
|
487 | 487 | $ hg qpush --move test.patch # noop move |
|
488 | 488 | applying test.patch |
|
489 | 489 | now at: test.patch |
|
490 | 490 | $ hg qseries -v |
|
491 | 491 | 0 A test2.patch |
|
492 | 492 | 1 A test1b.patch |
|
493 | 493 | 2 A test.patch |
|
494 | 494 | $ hg qpop -a |
|
495 | 495 | popping test.patch |
|
496 | 496 | popping test1b.patch |
|
497 | 497 | popping test2.patch |
|
498 | 498 | patch queue now empty |
|
499 | 499 | |
|
500 | 500 | cleaning up |
|
501 | 501 | |
|
502 | 502 | $ hg qselect --none |
|
503 | 503 | guards deactivated |
|
504 | 504 | number of unguarded, unapplied patches has changed from 3 to 2 |
|
505 | 505 | $ hg qguard --none test1b.patch |
|
506 | 506 | $ hg qguard --none test2.patch |
|
507 | 507 | $ hg qpush --move test.patch |
|
508 | 508 | applying test.patch |
|
509 | 509 | now at: test.patch |
|
510 | 510 | $ hg qpush --move test1b.patch |
|
511 | 511 | applying test1b.patch |
|
512 | 512 | now at: test1b.patch |
|
513 | 513 | $ hg qpush --move bogus # nonexistent patch |
|
514 | 514 | abort: patch bogus not in series |
|
515 | 515 | [255] |
|
516 | 516 | $ hg qpush --move # no patch |
|
517 | 517 | abort: please specify the patch to move |
|
518 | 518 | [255] |
|
519 | 519 | $ hg qpush --move test.patch # already applied |
|
520 | 520 | abort: cannot push to a previous patch: test.patch |
|
521 | 521 | [255] |
|
522 | $ sed -i.bak '2i# make qtip index different in series and fullseries' `hg root`/.hg/patches/series | |
|
522 | $ sed -i.bak '2i\# make qtip index different in series and fullseries' `hg root`/.hg/patches/series | |
|
523 | 523 | $ cat `hg root`/.hg/patches/series |
|
524 | 524 | # comment |
|
525 | 525 | # make qtip index different in series and fullseries |
|
526 | 526 | |
|
527 | 527 | test.patch |
|
528 | 528 | test1b.patch |
|
529 | 529 | test2.patch |
|
530 | 530 | $ hg qpush --move test2.patch |
|
531 | 531 | applying test2.patch |
|
532 | 532 | now at: test2.patch |
|
533 | 533 | |
|
534 | 534 | |
|
535 | 535 | series after move |
|
536 | 536 | |
|
537 | 537 | $ cat `hg root`/.hg/patches/series |
|
538 | 538 | # comment |
|
539 | 539 | # make qtip index different in series and fullseries |
|
540 | 540 | |
|
541 | 541 | test.patch |
|
542 | 542 | test1b.patch |
|
543 | 543 | test2.patch |
|
544 | 544 | |
|
545 | 545 | |
|
546 | 546 | pop, qapplied, qunapplied |
|
547 | 547 | |
|
548 | 548 | $ hg qseries -v |
|
549 | 549 | 0 A test.patch |
|
550 | 550 | 1 A test1b.patch |
|
551 | 551 | 2 A test2.patch |
|
552 | 552 | |
|
553 | 553 | qapplied -1 test.patch |
|
554 | 554 | |
|
555 | 555 | $ hg qapplied -1 test.patch |
|
556 | 556 | only one patch applied |
|
557 | 557 | [1] |
|
558 | 558 | |
|
559 | 559 | qapplied -1 test1b.patch |
|
560 | 560 | |
|
561 | 561 | $ hg qapplied -1 test1b.patch |
|
562 | 562 | test.patch |
|
563 | 563 | |
|
564 | 564 | qapplied -1 test2.patch |
|
565 | 565 | |
|
566 | 566 | $ hg qapplied -1 test2.patch |
|
567 | 567 | test1b.patch |
|
568 | 568 | |
|
569 | 569 | qapplied -1 |
|
570 | 570 | |
|
571 | 571 | $ hg qapplied -1 |
|
572 | 572 | test1b.patch |
|
573 | 573 | |
|
574 | 574 | qapplied |
|
575 | 575 | |
|
576 | 576 | $ hg qapplied |
|
577 | 577 | test.patch |
|
578 | 578 | test1b.patch |
|
579 | 579 | test2.patch |
|
580 | 580 | |
|
581 | 581 | qapplied test1b.patch |
|
582 | 582 | |
|
583 | 583 | $ hg qapplied test1b.patch |
|
584 | 584 | test.patch |
|
585 | 585 | test1b.patch |
|
586 | 586 | |
|
587 | 587 | qunapplied -1 |
|
588 | 588 | |
|
589 | 589 | $ hg qunapplied -1 |
|
590 | 590 | all patches applied |
|
591 | 591 | [1] |
|
592 | 592 | |
|
593 | 593 | qunapplied |
|
594 | 594 | |
|
595 | 595 | $ hg qunapplied |
|
596 | 596 | |
|
597 | 597 | popping |
|
598 | 598 | |
|
599 | 599 | $ hg qpop |
|
600 | 600 | popping test2.patch |
|
601 | 601 | now at: test1b.patch |
|
602 | 602 | |
|
603 | 603 | qunapplied -1 |
|
604 | 604 | |
|
605 | 605 | $ hg qunapplied -1 |
|
606 | 606 | test2.patch |
|
607 | 607 | |
|
608 | 608 | qunapplied |
|
609 | 609 | |
|
610 | 610 | $ hg qunapplied |
|
611 | 611 | test2.patch |
|
612 | 612 | |
|
613 | 613 | qunapplied test2.patch |
|
614 | 614 | |
|
615 | 615 | $ hg qunapplied test2.patch |
|
616 | 616 | |
|
617 | 617 | qunapplied -1 test2.patch |
|
618 | 618 | |
|
619 | 619 | $ hg qunapplied -1 test2.patch |
|
620 | 620 | all patches applied |
|
621 | 621 | [1] |
|
622 | 622 | |
|
623 | 623 | popping -a |
|
624 | 624 | |
|
625 | 625 | $ hg qpop -a |
|
626 | 626 | popping test1b.patch |
|
627 | 627 | popping test.patch |
|
628 | 628 | patch queue now empty |
|
629 | 629 | |
|
630 | 630 | qapplied |
|
631 | 631 | |
|
632 | 632 | $ hg qapplied |
|
633 | 633 | |
|
634 | 634 | qapplied -1 |
|
635 | 635 | |
|
636 | 636 | $ hg qapplied -1 |
|
637 | 637 | no patches applied |
|
638 | 638 | [1] |
|
639 | 639 | $ hg qpush |
|
640 | 640 | applying test.patch |
|
641 | 641 | now at: test.patch |
|
642 | 642 | |
|
643 | 643 | |
|
644 | 644 | push should succeed |
|
645 | 645 | |
|
646 | 646 | $ hg qpop -a |
|
647 | 647 | popping test.patch |
|
648 | 648 | patch queue now empty |
|
649 | 649 | $ hg push ../../k |
|
650 | 650 | pushing to ../../k |
|
651 | 651 | searching for changes |
|
652 | 652 | adding changesets |
|
653 | 653 | adding manifests |
|
654 | 654 | adding file changes |
|
655 | 655 | added 1 changesets with 1 changes to 1 files |
|
656 | 656 | |
|
657 | 657 | |
|
658 | 658 | we want to start with some patches applied |
|
659 | 659 | |
|
660 | 660 | $ hg qpush -a |
|
661 | 661 | applying test.patch |
|
662 | 662 | applying test1b.patch |
|
663 | 663 | applying test2.patch |
|
664 | 664 | now at: test2.patch |
|
665 | 665 | |
|
666 | 666 | % pops all patches and succeeds |
|
667 | 667 | |
|
668 | 668 | $ hg qpop -a |
|
669 | 669 | popping test2.patch |
|
670 | 670 | popping test1b.patch |
|
671 | 671 | popping test.patch |
|
672 | 672 | patch queue now empty |
|
673 | 673 | |
|
674 | 674 | % does nothing and succeeds |
|
675 | 675 | |
|
676 | 676 | $ hg qpop -a |
|
677 | 677 | no patches applied |
|
678 | 678 | |
|
679 | 679 | % fails - nothing else to pop |
|
680 | 680 | |
|
681 | 681 | $ hg qpop |
|
682 | 682 | no patches applied |
|
683 | 683 | [1] |
|
684 | 684 | |
|
685 | 685 | % pushes a patch and succeeds |
|
686 | 686 | |
|
687 | 687 | $ hg qpush |
|
688 | 688 | applying test.patch |
|
689 | 689 | now at: test.patch |
|
690 | 690 | |
|
691 | 691 | % pops a patch and succeeds |
|
692 | 692 | |
|
693 | 693 | $ hg qpop |
|
694 | 694 | popping test.patch |
|
695 | 695 | patch queue now empty |
|
696 | 696 | |
|
697 | 697 | % pushes up to test1b.patch and succeeds |
|
698 | 698 | |
|
699 | 699 | $ hg qpush test1b.patch |
|
700 | 700 | applying test.patch |
|
701 | 701 | applying test1b.patch |
|
702 | 702 | now at: test1b.patch |
|
703 | 703 | |
|
704 | 704 | % does nothing and succeeds |
|
705 | 705 | |
|
706 | 706 | $ hg qpush test1b.patch |
|
707 | 707 | qpush: test1b.patch is already at the top |
|
708 | 708 | |
|
709 | 709 | % does nothing and succeeds |
|
710 | 710 | |
|
711 | 711 | $ hg qpop test1b.patch |
|
712 | 712 | qpop: test1b.patch is already at the top |
|
713 | 713 | |
|
714 | 714 | % fails - can't push to this patch |
|
715 | 715 | |
|
716 | 716 | $ hg qpush test.patch |
|
717 | 717 | abort: cannot push to a previous patch: test.patch |
|
718 | 718 | [255] |
|
719 | 719 | |
|
720 | 720 | % fails - can't pop to this patch |
|
721 | 721 | |
|
722 | 722 | $ hg qpop test2.patch |
|
723 | 723 | abort: patch test2.patch is not applied |
|
724 | 724 | [255] |
|
725 | 725 | |
|
726 | 726 | % pops up to test.patch and succeeds |
|
727 | 727 | |
|
728 | 728 | $ hg qpop test.patch |
|
729 | 729 | popping test1b.patch |
|
730 | 730 | now at: test.patch |
|
731 | 731 | |
|
732 | 732 | % pushes all patches and succeeds |
|
733 | 733 | |
|
734 | 734 | $ hg qpush -a |
|
735 | 735 | applying test1b.patch |
|
736 | 736 | applying test2.patch |
|
737 | 737 | now at: test2.patch |
|
738 | 738 | |
|
739 | 739 | % does nothing and succeeds |
|
740 | 740 | |
|
741 | 741 | $ hg qpush -a |
|
742 | 742 | all patches are currently applied |
|
743 | 743 | |
|
744 | 744 | % fails - nothing else to push |
|
745 | 745 | |
|
746 | 746 | $ hg qpush |
|
747 | 747 | patch series already fully applied |
|
748 | 748 | [1] |
|
749 | 749 | |
|
750 | 750 | % does nothing and succeeds |
|
751 | 751 | |
|
752 | 752 | $ hg qpush test2.patch |
|
753 | 753 | qpush: test2.patch is already at the top |
|
754 | 754 | |
|
755 | 755 | strip |
|
756 | 756 | |
|
757 | 757 | $ cd ../../b |
|
758 | 758 | $ echo x>x |
|
759 | 759 | $ hg ci -Ama |
|
760 | 760 | adding x |
|
761 | 761 | $ hg strip tip |
|
762 | 762 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
763 | 763 | saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob) |
|
764 | 764 | $ hg unbundle .hg/strip-backup/* |
|
765 | 765 | adding changesets |
|
766 | 766 | adding manifests |
|
767 | 767 | adding file changes |
|
768 | 768 | added 1 changesets with 1 changes to 1 files |
|
769 | 769 | (run 'hg update' to get a working copy) |
|
770 | 770 | |
|
771 | 771 | |
|
772 | 772 | strip with local changes, should complain |
|
773 | 773 | |
|
774 | 774 | $ hg up |
|
775 | 775 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
776 | 776 | $ echo y>y |
|
777 | 777 | $ hg add y |
|
778 | 778 | $ hg strip tip |
|
779 | 779 | abort: local changes found |
|
780 | 780 | [255] |
|
781 | 781 | |
|
782 | 782 | --force strip with local changes |
|
783 | 783 | |
|
784 | 784 | $ hg strip -f tip |
|
785 | 785 | 0 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
786 | 786 | saved backup bundle to $TESTTMP/b/.hg/strip-backup/*-backup.hg (glob) |
|
787 | 787 | |
|
788 | 788 | |
|
789 | 789 | cd b; hg qrefresh |
|
790 | 790 | |
|
791 | 791 | $ hg init refresh |
|
792 | 792 | $ cd refresh |
|
793 | 793 | $ echo a > a |
|
794 | 794 | $ hg ci -Ama |
|
795 | 795 | adding a |
|
796 | 796 | $ hg qnew -mfoo foo |
|
797 | 797 | $ echo a >> a |
|
798 | 798 | $ hg qrefresh |
|
799 | 799 | $ mkdir b |
|
800 | 800 | $ cd b |
|
801 | 801 | $ echo f > f |
|
802 | 802 | $ hg add f |
|
803 | 803 | $ hg qrefresh |
|
804 | 804 | $ cat ../.hg/patches/foo |
|
805 | 805 | foo |
|
806 | 806 | |
|
807 | 807 | diff -r cb9a9f314b8b a |
|
808 | 808 | --- a/a\t(?P<date>.*) (re) |
|
809 | 809 | \+\+\+ b/a\t(?P<date>.*) (re) |
|
810 | 810 | @@ -1,1 +1,2 @@ |
|
811 | 811 | a |
|
812 | 812 | +a |
|
813 | 813 | diff -r cb9a9f314b8b b/f |
|
814 | 814 | --- /dev/null\t(?P<date>.*) (re) |
|
815 | 815 | \+\+\+ b/b/f\t(?P<date>.*) (re) |
|
816 | 816 | @@ -0,0 +1,1 @@ |
|
817 | 817 | +f |
|
818 | 818 | |
|
819 | 819 | hg qrefresh . |
|
820 | 820 | |
|
821 | 821 | $ hg qrefresh . |
|
822 | 822 | $ cat ../.hg/patches/foo |
|
823 | 823 | foo |
|
824 | 824 | |
|
825 | 825 | diff -r cb9a9f314b8b b/f |
|
826 | 826 | --- /dev/null\t(?P<date>.*) (re) |
|
827 | 827 | \+\+\+ b/b/f\t(?P<date>.*) (re) |
|
828 | 828 | @@ -0,0 +1,1 @@ |
|
829 | 829 | +f |
|
830 | 830 | $ hg status |
|
831 | 831 | M a |
|
832 | 832 | |
|
833 | 833 | |
|
834 | 834 | qpush failure |
|
835 | 835 | |
|
836 | 836 | $ cd .. |
|
837 | 837 | $ hg qrefresh |
|
838 | 838 | $ hg qnew -mbar bar |
|
839 | 839 | $ echo foo > foo |
|
840 | 840 | $ echo bar > bar |
|
841 | 841 | $ hg add foo bar |
|
842 | 842 | $ hg qrefresh |
|
843 | 843 | $ hg qpop -a |
|
844 | 844 | popping bar |
|
845 | 845 | popping foo |
|
846 | 846 | patch queue now empty |
|
847 | 847 | $ echo bar > foo |
|
848 | 848 | $ hg qpush -a |
|
849 | 849 | applying foo |
|
850 | 850 | applying bar |
|
851 | 851 | file foo already exists |
|
852 | 852 | 1 out of 1 hunks FAILED -- saving rejects to file foo.rej |
|
853 | 853 | patch failed, unable to continue (try -v) |
|
854 | 854 | patch failed, rejects left in working dir |
|
855 | 855 | errors during apply, please fix and refresh bar |
|
856 | 856 | [2] |
|
857 | 857 | $ hg st |
|
858 | 858 | ? foo |
|
859 | 859 | ? foo.rej |
|
860 | 860 | |
|
861 | 861 | |
|
862 | 862 | mq tags |
|
863 | 863 | |
|
864 | 864 | $ hg log --template '{rev} {tags}\n' -r qparent:qtip |
|
865 | 865 | 0 qparent |
|
866 | 866 | 1 foo qbase |
|
867 | 867 | 2 bar qtip tip |
|
868 | 868 | |
|
869 | 869 | mq revset |
|
870 | 870 | |
|
871 | 871 | $ hg log -r 'mq()' --template '{rev}\n' |
|
872 | 872 | 1 |
|
873 | 873 | 2 |
|
874 | 874 | $ hg help revsets | grep -i mq |
|
875 | 875 | "mq()" |
|
876 | 876 | Changesets managed by MQ. |
|
877 | 877 | |
|
878 | 878 | bad node in status |
|
879 | 879 | |
|
880 | 880 | $ hg qpop |
|
881 | 881 | popping bar |
|
882 | 882 | now at: foo |
|
883 | 883 | $ hg strip -qn tip |
|
884 | 884 | $ hg tip |
|
885 | 885 | changeset: 0:cb9a9f314b8b |
|
886 | 886 | tag: tip |
|
887 | 887 | user: test |
|
888 | 888 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
889 | 889 | summary: a |
|
890 | 890 | |
|
891 | 891 | $ hg branches |
|
892 | 892 | default 0:cb9a9f314b8b |
|
893 | 893 | $ hg qpop |
|
894 | 894 | no patches applied |
|
895 | 895 | [1] |
|
896 | 896 | |
|
897 | 897 | $ cat >>$HGRCPATH <<EOF |
|
898 | 898 | > [diff] |
|
899 | 899 | > git = True |
|
900 | 900 | > EOF |
|
901 | 901 | $ cd .. |
|
902 | 902 | $ hg init git |
|
903 | 903 | $ cd git |
|
904 | 904 | $ hg qinit |
|
905 | 905 | |
|
906 | 906 | $ hg qnew -m'new file' new |
|
907 | 907 | $ echo foo > new |
|
908 | 908 | $ chmod +x new |
|
909 | 909 | $ hg add new |
|
910 | 910 | $ hg qrefresh |
|
911 | 911 | $ cat .hg/patches/new |
|
912 | 912 | new file |
|
913 | 913 | |
|
914 | 914 | diff --git a/new b/new |
|
915 | 915 | new file mode 100755 |
|
916 | 916 | --- /dev/null |
|
917 | 917 | +++ b/new |
|
918 | 918 | @@ -0,0 +1,1 @@ |
|
919 | 919 | +foo |
|
920 | 920 | |
|
921 | 921 | $ hg qnew -m'copy file' copy |
|
922 | 922 | $ hg cp new copy |
|
923 | 923 | $ hg qrefresh |
|
924 | 924 | $ cat .hg/patches/copy |
|
925 | 925 | copy file |
|
926 | 926 | |
|
927 | 927 | diff --git a/new b/copy |
|
928 | 928 | copy from new |
|
929 | 929 | copy to copy |
|
930 | 930 | |
|
931 | 931 | $ hg qpop |
|
932 | 932 | popping copy |
|
933 | 933 | now at: new |
|
934 | 934 | $ hg qpush |
|
935 | 935 | applying copy |
|
936 | 936 | now at: copy |
|
937 | 937 | $ hg qdiff |
|
938 | 938 | diff --git a/new b/copy |
|
939 | 939 | copy from new |
|
940 | 940 | copy to copy |
|
941 | 941 | $ cat >>$HGRCPATH <<EOF |
|
942 | 942 | > [diff] |
|
943 | 943 | > git = False |
|
944 | 944 | > EOF |
|
945 | 945 | $ hg qdiff --git |
|
946 | 946 | diff --git a/new b/copy |
|
947 | 947 | copy from new |
|
948 | 948 | copy to copy |
|
949 | 949 | $ cd .. |
|
950 | 950 | |
|
951 | 951 | empty lines in status |
|
952 | 952 | |
|
953 | 953 | $ hg init emptystatus |
|
954 | 954 | $ cd emptystatus |
|
955 | 955 | $ hg qinit |
|
956 | 956 | $ printf '\n\n' > .hg/patches/status |
|
957 | 957 | $ hg qser |
|
958 | 958 | $ cd .. |
|
959 | 959 | |
|
960 | 960 | bad line in status (without ":") |
|
961 | 961 | |
|
962 | 962 | $ hg init badstatus |
|
963 | 963 | $ cd badstatus |
|
964 | 964 | $ hg qinit |
|
965 | 965 | $ printf 'babar has no colon in this line\n' > .hg/patches/status |
|
966 | 966 | $ hg qser |
|
967 | 967 | malformated mq status line: ['babar has no colon in this line'] |
|
968 | 968 | $ cd .. |
|
969 | 969 | |
|
970 | 970 | |
|
971 | 971 | test file addition in slow path |
|
972 | 972 | |
|
973 | 973 | $ hg init slow |
|
974 | 974 | $ cd slow |
|
975 | 975 | $ hg qinit |
|
976 | 976 | $ echo foo > foo |
|
977 | 977 | $ hg add foo |
|
978 | 978 | $ hg ci -m 'add foo' |
|
979 | 979 | $ hg qnew bar |
|
980 | 980 | $ echo bar > bar |
|
981 | 981 | $ hg add bar |
|
982 | 982 | $ hg mv foo baz |
|
983 | 983 | $ hg qrefresh --git |
|
984 | 984 | $ hg up -C 0 |
|
985 | 985 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
986 | 986 | $ echo >> foo |
|
987 | 987 | $ hg ci -m 'change foo' |
|
988 | 988 | created new head |
|
989 | 989 | $ hg up -C 1 |
|
990 | 990 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
991 | 991 | $ hg qrefresh --git |
|
992 | 992 | $ cat .hg/patches/bar |
|
993 | 993 | diff --git a/bar b/bar |
|
994 | 994 | new file mode 100644 |
|
995 | 995 | --- /dev/null |
|
996 | 996 | +++ b/bar |
|
997 | 997 | @@ -0,0 +1,1 @@ |
|
998 | 998 | +bar |
|
999 | 999 | diff --git a/foo b/baz |
|
1000 | 1000 | rename from foo |
|
1001 | 1001 | rename to baz |
|
1002 | 1002 | $ hg log -v --template '{rev} {file_copies}\n' -r . |
|
1003 | 1003 | 2 baz (foo) |
|
1004 | 1004 | $ hg qrefresh --git |
|
1005 | 1005 | $ cat .hg/patches/bar |
|
1006 | 1006 | diff --git a/bar b/bar |
|
1007 | 1007 | new file mode 100644 |
|
1008 | 1008 | --- /dev/null |
|
1009 | 1009 | +++ b/bar |
|
1010 | 1010 | @@ -0,0 +1,1 @@ |
|
1011 | 1011 | +bar |
|
1012 | 1012 | diff --git a/foo b/baz |
|
1013 | 1013 | rename from foo |
|
1014 | 1014 | rename to baz |
|
1015 | 1015 | $ hg log -v --template '{rev} {file_copies}\n' -r . |
|
1016 | 1016 | 2 baz (foo) |
|
1017 | 1017 | $ hg qrefresh |
|
1018 | 1018 | $ grep 'diff --git' .hg/patches/bar |
|
1019 | 1019 | diff --git a/bar b/bar |
|
1020 | 1020 | diff --git a/foo b/baz |
|
1021 | 1021 | |
|
1022 | 1022 | |
|
1023 | 1023 | test file move chains in the slow path |
|
1024 | 1024 | |
|
1025 | 1025 | $ hg up -C 1 |
|
1026 | 1026 | 1 files updated, 0 files merged, 2 files removed, 0 files unresolved |
|
1027 | 1027 | $ echo >> foo |
|
1028 | 1028 | $ hg ci -m 'change foo again' |
|
1029 | 1029 | $ hg up -C 2 |
|
1030 | 1030 | 2 files updated, 0 files merged, 1 files removed, 0 files unresolved |
|
1031 | 1031 | $ hg mv bar quux |
|
1032 | 1032 | $ hg mv baz bleh |
|
1033 | 1033 | $ hg qrefresh --git |
|
1034 | 1034 | $ cat .hg/patches/bar |
|
1035 | 1035 | diff --git a/foo b/bleh |
|
1036 | 1036 | rename from foo |
|
1037 | 1037 | rename to bleh |
|
1038 | 1038 | diff --git a/quux b/quux |
|
1039 | 1039 | new file mode 100644 |
|
1040 | 1040 | --- /dev/null |
|
1041 | 1041 | +++ b/quux |
|
1042 | 1042 | @@ -0,0 +1,1 @@ |
|
1043 | 1043 | +bar |
|
1044 | 1044 | $ hg log -v --template '{rev} {file_copies}\n' -r . |
|
1045 | 1045 | 3 bleh (foo) |
|
1046 | 1046 | $ hg mv quux fred |
|
1047 | 1047 | $ hg mv bleh barney |
|
1048 | 1048 | $ hg qrefresh --git |
|
1049 | 1049 | $ cat .hg/patches/bar |
|
1050 | 1050 | diff --git a/foo b/barney |
|
1051 | 1051 | rename from foo |
|
1052 | 1052 | rename to barney |
|
1053 | 1053 | diff --git a/fred b/fred |
|
1054 | 1054 | new file mode 100644 |
|
1055 | 1055 | --- /dev/null |
|
1056 | 1056 | +++ b/fred |
|
1057 | 1057 | @@ -0,0 +1,1 @@ |
|
1058 | 1058 | +bar |
|
1059 | 1059 | $ hg log -v --template '{rev} {file_copies}\n' -r . |
|
1060 | 1060 | 3 barney (foo) |
|
1061 | 1061 | |
|
1062 | 1062 | |
|
1063 | 1063 | refresh omitting an added file |
|
1064 | 1064 | |
|
1065 | 1065 | $ hg qnew baz |
|
1066 | 1066 | $ echo newfile > newfile |
|
1067 | 1067 | $ hg add newfile |
|
1068 | 1068 | $ hg qrefresh |
|
1069 | 1069 | $ hg st -A newfile |
|
1070 | 1070 | C newfile |
|
1071 | 1071 | $ hg qrefresh -X newfile |
|
1072 | 1072 | $ hg st -A newfile |
|
1073 | 1073 | A newfile |
|
1074 | 1074 | $ hg revert newfile |
|
1075 | 1075 | $ rm newfile |
|
1076 | 1076 | $ hg qpop |
|
1077 | 1077 | popping baz |
|
1078 | 1078 | now at: bar |
|
1079 | 1079 | $ hg qdel baz |
|
1080 | 1080 | |
|
1081 | 1081 | |
|
1082 | 1082 | create a git patch |
|
1083 | 1083 | |
|
1084 | 1084 | $ echo a > alexander |
|
1085 | 1085 | $ hg add alexander |
|
1086 | 1086 | $ hg qnew -f --git addalexander |
|
1087 | 1087 | $ grep diff .hg/patches/addalexander |
|
1088 | 1088 | diff --git a/alexander b/alexander |
|
1089 | 1089 | |
|
1090 | 1090 | |
|
1091 | 1091 | create a git binary patch |
|
1092 | 1092 | |
|
1093 | 1093 | $ cat > writebin.py <<EOF |
|
1094 | 1094 | > import sys |
|
1095 | 1095 | > path = sys.argv[1] |
|
1096 | 1096 | > open(path, 'wb').write('BIN\x00ARY') |
|
1097 | 1097 | > EOF |
|
1098 | 1098 | $ python writebin.py bucephalus |
|
1099 | 1099 | |
|
1100 | 1100 | $ python "$TESTDIR/md5sum.py" bucephalus |
|
1101 | 1101 | 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus |
|
1102 | 1102 | $ hg add bucephalus |
|
1103 | 1103 | $ hg qnew -f --git addbucephalus |
|
1104 | 1104 | $ grep diff .hg/patches/addbucephalus |
|
1105 | 1105 | diff --git a/bucephalus b/bucephalus |
|
1106 | 1106 | |
|
1107 | 1107 | |
|
1108 | 1108 | check binary patches can be popped and pushed |
|
1109 | 1109 | |
|
1110 | 1110 | $ hg qpop |
|
1111 | 1111 | popping addbucephalus |
|
1112 | 1112 | now at: addalexander |
|
1113 | 1113 | $ test -f bucephalus && echo % bucephalus should not be there |
|
1114 | 1114 | [1] |
|
1115 | 1115 | $ hg qpush |
|
1116 | 1116 | applying addbucephalus |
|
1117 | 1117 | now at: addbucephalus |
|
1118 | 1118 | $ test -f bucephalus |
|
1119 | 1119 | $ python "$TESTDIR/md5sum.py" bucephalus |
|
1120 | 1120 | 8ba2a2f3e77b55d03051ff9c24ad65e7 bucephalus |
|
1121 | 1121 | |
|
1122 | 1122 | |
|
1123 | 1123 | |
|
1124 | 1124 | strip again |
|
1125 | 1125 | |
|
1126 | 1126 | $ cd .. |
|
1127 | 1127 | $ hg init strip |
|
1128 | 1128 | $ cd strip |
|
1129 | 1129 | $ touch foo |
|
1130 | 1130 | $ hg add foo |
|
1131 | 1131 | $ hg ci -m 'add foo' |
|
1132 | 1132 | $ echo >> foo |
|
1133 | 1133 | $ hg ci -m 'change foo 1' |
|
1134 | 1134 | $ hg up -C 0 |
|
1135 | 1135 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1136 | 1136 | $ echo 1 >> foo |
|
1137 | 1137 | $ hg ci -m 'change foo 2' |
|
1138 | 1138 | created new head |
|
1139 | 1139 | $ HGMERGE=true hg merge |
|
1140 | 1140 | merging foo |
|
1141 | 1141 | 0 files updated, 1 files merged, 0 files removed, 0 files unresolved |
|
1142 | 1142 | (branch merge, don't forget to commit) |
|
1143 | 1143 | $ hg ci -m merge |
|
1144 | 1144 | $ hg log |
|
1145 | 1145 | changeset: 3:99615015637b |
|
1146 | 1146 | tag: tip |
|
1147 | 1147 | parent: 2:20cbbe65cff7 |
|
1148 | 1148 | parent: 1:d2871fc282d4 |
|
1149 | 1149 | user: test |
|
1150 | 1150 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1151 | 1151 | summary: merge |
|
1152 | 1152 | |
|
1153 | 1153 | changeset: 2:20cbbe65cff7 |
|
1154 | 1154 | parent: 0:53245c60e682 |
|
1155 | 1155 | user: test |
|
1156 | 1156 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1157 | 1157 | summary: change foo 2 |
|
1158 | 1158 | |
|
1159 | 1159 | changeset: 1:d2871fc282d4 |
|
1160 | 1160 | user: test |
|
1161 | 1161 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1162 | 1162 | summary: change foo 1 |
|
1163 | 1163 | |
|
1164 | 1164 | changeset: 0:53245c60e682 |
|
1165 | 1165 | user: test |
|
1166 | 1166 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1167 | 1167 | summary: add foo |
|
1168 | 1168 | |
|
1169 | 1169 | $ hg strip 1 |
|
1170 | 1170 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1171 | 1171 | saved backup bundle to $TESTTMP/b/strip/.hg/strip-backup/*-backup.hg (glob) |
|
1172 | 1172 | $ checkundo strip |
|
1173 | 1173 | $ hg log |
|
1174 | 1174 | changeset: 1:20cbbe65cff7 |
|
1175 | 1175 | tag: tip |
|
1176 | 1176 | user: test |
|
1177 | 1177 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1178 | 1178 | summary: change foo 2 |
|
1179 | 1179 | |
|
1180 | 1180 | changeset: 0:53245c60e682 |
|
1181 | 1181 | user: test |
|
1182 | 1182 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1183 | 1183 | summary: add foo |
|
1184 | 1184 | |
|
1185 | 1185 | $ cd .. |
|
1186 | 1186 | |
|
1187 | 1187 | |
|
1188 | 1188 | qclone |
|
1189 | 1189 | |
|
1190 | 1190 | $ qlog() |
|
1191 | 1191 | > { |
|
1192 | 1192 | > echo 'main repo:' |
|
1193 | 1193 | > hg log --template ' rev {rev}: {desc}\n' |
|
1194 | 1194 | > echo 'patch repo:' |
|
1195 | 1195 | > hg -R .hg/patches log --template ' rev {rev}: {desc}\n' |
|
1196 | 1196 | > } |
|
1197 | 1197 | $ hg init qclonesource |
|
1198 | 1198 | $ cd qclonesource |
|
1199 | 1199 | $ echo foo > foo |
|
1200 | 1200 | $ hg add foo |
|
1201 | 1201 | $ hg ci -m 'add foo' |
|
1202 | 1202 | $ hg qinit |
|
1203 | 1203 | $ hg qnew patch1 |
|
1204 | 1204 | $ echo bar >> foo |
|
1205 | 1205 | $ hg qrefresh -m 'change foo' |
|
1206 | 1206 | $ cd .. |
|
1207 | 1207 | |
|
1208 | 1208 | |
|
1209 | 1209 | repo with unversioned patch dir |
|
1210 | 1210 | |
|
1211 | 1211 | $ hg qclone qclonesource failure |
|
1212 | 1212 | abort: versioned patch repository not found (see init --mq) |
|
1213 | 1213 | [255] |
|
1214 | 1214 | |
|
1215 | 1215 | $ cd qclonesource |
|
1216 | 1216 | $ hg qinit -c |
|
1217 | 1217 | adding .hg/patches/patch1 (glob) |
|
1218 | 1218 | $ hg qci -m checkpoint |
|
1219 | 1219 | $ qlog |
|
1220 | 1220 | main repo: |
|
1221 | 1221 | rev 1: change foo |
|
1222 | 1222 | rev 0: add foo |
|
1223 | 1223 | patch repo: |
|
1224 | 1224 | rev 0: checkpoint |
|
1225 | 1225 | $ cd .. |
|
1226 | 1226 | |
|
1227 | 1227 | |
|
1228 | 1228 | repo with patches applied |
|
1229 | 1229 | |
|
1230 | 1230 | $ hg qclone qclonesource qclonedest |
|
1231 | 1231 | updating to branch default |
|
1232 | 1232 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1233 | 1233 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1234 | 1234 | $ cd qclonedest |
|
1235 | 1235 | $ qlog |
|
1236 | 1236 | main repo: |
|
1237 | 1237 | rev 0: add foo |
|
1238 | 1238 | patch repo: |
|
1239 | 1239 | rev 0: checkpoint |
|
1240 | 1240 | $ cd .. |
|
1241 | 1241 | |
|
1242 | 1242 | |
|
1243 | 1243 | repo with patches unapplied |
|
1244 | 1244 | |
|
1245 | 1245 | $ cd qclonesource |
|
1246 | 1246 | $ hg qpop -a |
|
1247 | 1247 | popping patch1 |
|
1248 | 1248 | patch queue now empty |
|
1249 | 1249 | $ qlog |
|
1250 | 1250 | main repo: |
|
1251 | 1251 | rev 0: add foo |
|
1252 | 1252 | patch repo: |
|
1253 | 1253 | rev 0: checkpoint |
|
1254 | 1254 | $ cd .. |
|
1255 | 1255 | $ hg qclone qclonesource qclonedest2 |
|
1256 | 1256 | updating to branch default |
|
1257 | 1257 | 3 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1258 | 1258 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1259 | 1259 | $ cd qclonedest2 |
|
1260 | 1260 | $ qlog |
|
1261 | 1261 | main repo: |
|
1262 | 1262 | rev 0: add foo |
|
1263 | 1263 | patch repo: |
|
1264 | 1264 | rev 0: checkpoint |
|
1265 | 1265 | $ cd .. |
|
1266 | 1266 | |
|
1267 | 1267 | |
|
1268 | 1268 | Issue1033: test applying on an empty file |
|
1269 | 1269 | |
|
1270 | 1270 | $ hg init empty |
|
1271 | 1271 | $ cd empty |
|
1272 | 1272 | $ touch a |
|
1273 | 1273 | $ hg ci -Am addempty |
|
1274 | 1274 | adding a |
|
1275 | 1275 | $ echo a > a |
|
1276 | 1276 | $ hg qnew -f -e changea |
|
1277 | 1277 | $ hg qpop |
|
1278 | 1278 | popping changea |
|
1279 | 1279 | patch queue now empty |
|
1280 | 1280 | $ hg qpush |
|
1281 | 1281 | applying changea |
|
1282 | 1282 | now at: changea |
|
1283 | 1283 | $ cd .. |
|
1284 | 1284 | |
|
1285 | 1285 | test qpush with --force, issue1087 |
|
1286 | 1286 | |
|
1287 | 1287 | $ hg init forcepush |
|
1288 | 1288 | $ cd forcepush |
|
1289 | 1289 | $ echo hello > hello.txt |
|
1290 | 1290 | $ echo bye > bye.txt |
|
1291 | 1291 | $ hg ci -Ama |
|
1292 | 1292 | adding bye.txt |
|
1293 | 1293 | adding hello.txt |
|
1294 | 1294 | $ hg qnew -d '0 0' empty |
|
1295 | 1295 | $ hg qpop |
|
1296 | 1296 | popping empty |
|
1297 | 1297 | patch queue now empty |
|
1298 | 1298 | $ echo world >> hello.txt |
|
1299 | 1299 | |
|
1300 | 1300 | |
|
1301 | 1301 | qpush should fail, local changes |
|
1302 | 1302 | |
|
1303 | 1303 | $ hg qpush |
|
1304 | 1304 | abort: local changes found |
|
1305 | 1305 | [255] |
|
1306 | 1306 | |
|
1307 | 1307 | |
|
1308 | 1308 | apply force, should not discard changes with empty patch |
|
1309 | 1309 | |
|
1310 | 1310 | $ hg qpush -f |
|
1311 | 1311 | applying empty |
|
1312 | 1312 | patch empty is empty |
|
1313 | 1313 | now at: empty |
|
1314 | 1314 | $ hg diff --config diff.nodates=True |
|
1315 | 1315 | diff -r d58265112590 hello.txt |
|
1316 | 1316 | --- a/hello.txt |
|
1317 | 1317 | +++ b/hello.txt |
|
1318 | 1318 | @@ -1,1 +1,2 @@ |
|
1319 | 1319 | hello |
|
1320 | 1320 | +world |
|
1321 | 1321 | $ hg qdiff --config diff.nodates=True |
|
1322 | 1322 | diff -r 9ecee4f634e3 hello.txt |
|
1323 | 1323 | --- a/hello.txt |
|
1324 | 1324 | +++ b/hello.txt |
|
1325 | 1325 | @@ -1,1 +1,2 @@ |
|
1326 | 1326 | hello |
|
1327 | 1327 | +world |
|
1328 | 1328 | $ hg log -l1 -p |
|
1329 | 1329 | changeset: 1:d58265112590 |
|
1330 | 1330 | tag: empty |
|
1331 | 1331 | tag: qbase |
|
1332 | 1332 | tag: qtip |
|
1333 | 1333 | tag: tip |
|
1334 | 1334 | user: test |
|
1335 | 1335 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
1336 | 1336 | summary: imported patch empty |
|
1337 | 1337 | |
|
1338 | 1338 | |
|
1339 | 1339 | $ hg qref -d '0 0' |
|
1340 | 1340 | $ hg qpop |
|
1341 | 1341 | popping empty |
|
1342 | 1342 | patch queue now empty |
|
1343 | 1343 | $ echo universe >> hello.txt |
|
1344 | 1344 | $ echo universe >> bye.txt |
|
1345 | 1345 | |
|
1346 | 1346 | |
|
1347 | 1347 | qpush should fail, local changes |
|
1348 | 1348 | |
|
1349 | 1349 | $ hg qpush |
|
1350 | 1350 | abort: local changes found |
|
1351 | 1351 | [255] |
|
1352 | 1352 | |
|
1353 | 1353 | |
|
1354 | 1354 | apply force, should discard changes in hello, but not bye |
|
1355 | 1355 | |
|
1356 | 1356 | $ hg qpush -f |
|
1357 | 1357 | applying empty |
|
1358 | 1358 | now at: empty |
|
1359 | 1359 | $ hg st |
|
1360 | 1360 | M bye.txt |
|
1361 | 1361 | $ hg diff --config diff.nodates=True |
|
1362 | 1362 | diff -r ba252371dbc1 bye.txt |
|
1363 | 1363 | --- a/bye.txt |
|
1364 | 1364 | +++ b/bye.txt |
|
1365 | 1365 | @@ -1,1 +1,2 @@ |
|
1366 | 1366 | bye |
|
1367 | 1367 | +universe |
|
1368 | 1368 | $ hg qdiff --config diff.nodates=True |
|
1369 | 1369 | diff -r 9ecee4f634e3 bye.txt |
|
1370 | 1370 | --- a/bye.txt |
|
1371 | 1371 | +++ b/bye.txt |
|
1372 | 1372 | @@ -1,1 +1,2 @@ |
|
1373 | 1373 | bye |
|
1374 | 1374 | +universe |
|
1375 | 1375 | diff -r 9ecee4f634e3 hello.txt |
|
1376 | 1376 | --- a/hello.txt |
|
1377 | 1377 | +++ b/hello.txt |
|
1378 | 1378 | @@ -1,1 +1,3 @@ |
|
1379 | 1379 | hello |
|
1380 | 1380 | +world |
|
1381 | 1381 | +universe |
|
1382 | 1382 | |
|
1383 | 1383 | |
|
1384 | 1384 | test popping revisions not in working dir ancestry |
|
1385 | 1385 | |
|
1386 | 1386 | $ hg qseries -v |
|
1387 | 1387 | 0 A empty |
|
1388 | 1388 | $ hg up qparent |
|
1389 | 1389 | 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
|
1390 | 1390 | $ hg qpop |
|
1391 | 1391 | popping empty |
|
1392 | 1392 | patch queue now empty |
|
1393 | 1393 | |
|
1394 | 1394 | $ cd .. |
|
1395 | 1395 | $ hg init deletion-order |
|
1396 | 1396 | $ cd deletion-order |
|
1397 | 1397 | |
|
1398 | 1398 | $ touch a |
|
1399 | 1399 | $ hg ci -Aqm0 |
|
1400 | 1400 | |
|
1401 | 1401 | $ hg qnew rename-dir |
|
1402 | 1402 | $ hg rm a |
|
1403 | 1403 | $ hg qrefresh |
|
1404 | 1404 | |
|
1405 | 1405 | $ mkdir a b |
|
1406 | 1406 | $ touch a/a b/b |
|
1407 | 1407 | $ hg add -q a b |
|
1408 | 1408 | $ hg qrefresh |
|
1409 | 1409 | |
|
1410 | 1410 | |
|
1411 | 1411 | test popping must remove files added in subdirectories first |
|
1412 | 1412 | |
|
1413 | 1413 | $ hg qpop |
|
1414 | 1414 | popping rename-dir |
|
1415 | 1415 | patch queue now empty |
|
1416 | 1416 | $ cd .. |
|
1417 | 1417 | |
|
1418 | 1418 | |
|
1419 | 1419 | test case preservation through patch pushing especially on case |
|
1420 | 1420 | insensitive filesystem |
|
1421 | 1421 | |
|
1422 | 1422 | $ hg init casepreserve |
|
1423 | 1423 | $ cd casepreserve |
|
1424 | 1424 | |
|
1425 | 1425 | $ hg qnew add-file1 |
|
1426 | 1426 | $ echo a > TeXtFiLe.TxT |
|
1427 | 1427 | $ hg add TeXtFiLe.TxT |
|
1428 | 1428 | $ hg qrefresh |
|
1429 | 1429 | |
|
1430 | 1430 | $ hg qnew add-file2 |
|
1431 | 1431 | $ echo b > AnOtHeRFiLe.TxT |
|
1432 | 1432 | $ hg add AnOtHeRFiLe.TxT |
|
1433 | 1433 | $ hg qrefresh |
|
1434 | 1434 | |
|
1435 | 1435 | $ hg qnew modify-file |
|
1436 | 1436 | $ echo c >> AnOtHeRFiLe.TxT |
|
1437 | 1437 | $ hg qrefresh |
|
1438 | 1438 | |
|
1439 | 1439 | $ hg qapplied |
|
1440 | 1440 | add-file1 |
|
1441 | 1441 | add-file2 |
|
1442 | 1442 | modify-file |
|
1443 | 1443 | $ hg qpop -a |
|
1444 | 1444 | popping modify-file |
|
1445 | 1445 | popping add-file2 |
|
1446 | 1446 | popping add-file1 |
|
1447 | 1447 | patch queue now empty |
|
1448 | 1448 | |
|
1449 | 1449 | this qpush causes problems below, if case preservation on case |
|
1450 | 1450 | insensitive filesystem is not enough: |
|
1451 | 1451 | (1) unexpected "adding ..." messages are shown |
|
1452 | 1452 | (2) patching fails in modification of (1) files |
|
1453 | 1453 | |
|
1454 | 1454 | $ hg qpush -a |
|
1455 | 1455 | applying add-file1 |
|
1456 | 1456 | applying add-file2 |
|
1457 | 1457 | applying modify-file |
|
1458 | 1458 | now at: modify-file |
|
1459 | 1459 | |
|
1460 | 1460 | Proper phase default with mq: |
|
1461 | 1461 | |
|
1462 | 1462 | 1. mq.secret=false |
|
1463 | 1463 | |
|
1464 | 1464 | $ rm .hg/store/phaseroots |
|
1465 | 1465 | $ hg phase 'qparent::' |
|
1466 | 1466 | 0: draft |
|
1467 | 1467 | 1: draft |
|
1468 | 1468 | 2: draft |
|
1469 | 1469 | $ echo '[mq]' >> $HGRCPATH |
|
1470 | 1470 | $ echo 'secret=true' >> $HGRCPATH |
|
1471 | 1471 | $ rm -f .hg/store/phaseroots |
|
1472 | 1472 | $ hg phase 'qparent::' |
|
1473 | 1473 | 0: secret |
|
1474 | 1474 | 1: secret |
|
1475 | 1475 | 2: secret |
|
1476 | 1476 | |
|
1477 | 1477 | Test that qfinish change phase when mq.secret=true |
|
1478 | 1478 | |
|
1479 | 1479 | $ hg qfinish qbase |
|
1480 | 1480 | patch add-file1 finalized without changeset message |
|
1481 | 1481 | $ hg phase 'all()' |
|
1482 | 1482 | 0: draft |
|
1483 | 1483 | 1: secret |
|
1484 | 1484 | 2: secret |
|
1485 | 1485 | |
|
1486 | 1486 | Test that qfinish respect phases.new-commit setting |
|
1487 | 1487 | |
|
1488 | 1488 | $ echo '[phases]' >> $HGRCPATH |
|
1489 | 1489 | $ echo 'new-commit=secret' >> $HGRCPATH |
|
1490 | 1490 | $ hg qfinish qbase |
|
1491 | 1491 | patch add-file2 finalized without changeset message |
|
1492 | 1492 | $ hg phase 'all()' |
|
1493 | 1493 | 0: draft |
|
1494 | 1494 | 1: secret |
|
1495 | 1495 | 2: secret |
|
1496 | 1496 | |
|
1497 | 1497 | (restore env for next test) |
|
1498 | 1498 | |
|
1499 | 1499 | $ sed -i.bak -e 's/new-commit=secret//' $HGRCPATH |
|
1500 | 1500 | $ hg qimport -r 1 --name add-file2 |
|
1501 | 1501 | |
|
1502 | 1502 | Test that qfinish preserve phase when mq.secret=false |
|
1503 | 1503 | |
|
1504 | 1504 | $ sed -i.bak -e 's/secret=true/secret=false/' $HGRCPATH |
|
1505 | 1505 | $ hg qfinish qbase |
|
1506 | 1506 | patch add-file2 finalized without changeset message |
|
1507 | 1507 | $ hg phase 'all()' |
|
1508 | 1508 | 0: draft |
|
1509 | 1509 | 1: secret |
|
1510 | 1510 | 2: secret |
General Comments 0
You need to be logged in to leave comments.
Login now