Mercurial > evolve
comparison tests/test-split.t @ 1598:2a08ef812b84
evolve: make split respect rev args passed without --rev or -r
Currently, if one runs `hg split .` or `hg split`, it will fail
with an exception. This happens becuase we only expect revision
args to be passed as --rev/-r ones and don't treat unnamed args
properly or add default values if no args are provided.
author | Kostia Balytskyi <ikostia@fb.com> |
---|---|
date | Thu, 04 Feb 2016 02:46:40 -0800 |
parents | 1ba64be11bf8 |
children | c2739551ea4e 27445da063b7 |
comparison
equal
deleted
inserted
replaced
1597:7876ed4fceb7 | 1598:2a08ef812b84 |
---|---|
318 | | 318 | |
319 $ hg book | 319 $ hg book |
320 bookA 19:a2b5c9d9b362 | 320 bookA 19:a2b5c9d9b362 |
321 * bookB 19:a2b5c9d9b362 | 321 * bookB 19:a2b5c9d9b362 |
322 | 322 |
323 Cannot specify multiple revisions with -r | 323 Lastest revision is selected if multiple are given to -r |
324 $ hg split -r "desc(_a)::" | 324 $ hg split -r "desc(_a)::" |
325 abort: you can only specify one revision to split | 325 (leaving bookmark bookB) |
326 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
327 adding _d | |
328 diff --git a/_d b/_d | |
329 new file mode 100644 | |
330 examine changes to '_d'? [Ynesfdaq?] abort: response expected | |
326 [255] | 331 [255] |
327 | 332 |
328 Cannot split a commit that is not a head if instability is not allowed | 333 Cannot split a commit that is not a head if instability is not allowed |
329 $ cat >> $HGRCPATH <<EOF | 334 $ cat >> $HGRCPATH <<EOF |
330 > [experimental] | 335 > [experimental] |
333 > EOF | 338 > EOF |
334 $ hg split -r "desc(split3)" | 339 $ hg split -r "desc(split3)" |
335 abort: cannot split commit: ced8fbcce3a7 not a head | 340 abort: cannot split commit: ced8fbcce3a7 not a head |
336 [255] | 341 [255] |
337 | 342 |
338 | 343 Changing evolution level to createmarkers |
344 $ echo "[experimental]" >> $HGRCPATH | |
345 $ echo "evolution=createmarkers" >> $HGRCPATH | |
346 | |
347 Running split without any revision operates on the parent of the working copy | |
348 $ hg split << EOF | |
349 > q | |
350 > EOF | |
351 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
352 adding _d | |
353 diff --git a/_d b/_d | |
354 new file mode 100644 | |
355 examine changes to '_d'? [Ynesfdaq?] q | |
356 | |
357 abort: user quit | |
358 [255] | |
359 | |
360 Running split with tip revision, specified as unnamed argument | |
361 $ hg split . << EOF | |
362 > q | |
363 > EOF | |
364 0 files updated, 0 files merged, 1 files removed, 0 files unresolved | |
365 adding _d | |
366 diff --git a/_d b/_d | |
367 new file mode 100644 | |
368 examine changes to '_d'? [Ynesfdaq?] q | |
369 | |
370 abort: user quit | |
371 [255] | |
372 | |
373 Running split with both unnamed and named revision arguments shows an error msg | |
374 $ hg split . --rev .^ << EOF | |
375 > q | |
376 > EOF | |
377 abort: more than one revset is given | |
378 (use either `hg split <rs>` or `hg split --rev <rs>`, not both) | |
379 [255] | |
380 |