comparison tests/test-tutorial.t @ 996:b98dd5d3065c

fold: overhaul handling of revisions with --rev (BC) The fold command parsed the revision arguments in a very peculiar and idiosyncratic fashion: if revisions were passed without a --rev argument, then they would all be extended to ".", but if they were passed with --rev, then no extension would happen. Passing revisions both with and without --rev would abort. This is inconsistent with the way all other hg commands parse revision arguments. We have several examples of command where several revisions are passed, and the --rev option is optional for specifying those revisions (update, strip, export). This patch alters the way in which fold parses its revision arguments. No distinction is made between revisions passed with or without the --rev argument. Regardless if a single or multiple revision is specified, all will be folded together into the parent of the working directory. If the --exact argument is passed, then the parent of the working directory is ignored and the specified revisions must be a single contiguous line. The docstring and tests are modified accordingly.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Mon, 30 Jun 2014 13:29:49 -0400
parents 2cde59f3cb5d
children 59bc29c84ce0
comparison
equal deleted inserted replaced
995:0f3a7efd6ee9 996:b98dd5d3065c
471 ------------------ 471 ------------------
472 472
473 The tutorial part is not written yet but can use `hg fold`: 473 The tutorial part is not written yet but can use `hg fold`:
474 474
475 $ hg help fold 475 $ hg help fold
476 hg fold rev 476 hg fold [OPTION]... [-r] REV
477 477
478 aliases: squash 478 aliases: squash
479 479
480 Fold multiple revisions into a single one 480 fold multiple revisions into a single one
481 481
482 The revisions from your current working directory to the given one are 482 Folds a set of revisions with the parent of the working directory. All
483 folded into a single successor revision. 483 revisions linearly between the given revisions and the parent of the
484 484 working directory will also be folded.
485 you can alternatively use --rev to explicitly specify revisions to be 485
486 folded, ignoring the current working directory parent. 486 Use --exact for folding only the specified revisions while ignoring the
487 parent of the working directory. In this case, the given revisions must
488 form a linear unbroken chain.
487 489
488 options: 490 options:
489 491
490 -r --rev VALUE [+] explicitly specify the full set of revision to fold 492 -r --rev VALUE [+] revision to fold
493 --exact only fold specified revisions
491 -m --message TEXT use text as commit message 494 -m --message TEXT use text as commit message
492 -l --logfile FILE read commit message from file 495 -l --logfile FILE read commit message from file
493 -d --date DATE record the specified date as commit date 496 -d --date DATE record the specified date as commit date
494 -u --user USER record the specified user as committer 497 -u --user USER record the specified user as committer
495 498
496 [+] marked option can be specified multiple times 499 [+] marked option can be specified multiple times
497 500
498 use "hg -v help fold" to show the global options 501 use "hg -v help fold" to show more complete help and the global options
499 502
500 503
501 ----------------------- 504 -----------------------
502 Collaboration 505 Collaboration
503 ----------------------- 506 -----------------------