changeset 2768:85e5a56db776

fold: add support for the -D and -U options
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Sun, 23 Jul 2017 07:32:54 +0200
parents ab80ef8d0cfa
children b96349ae3e2a
files README hgext3rd/evolve/evocommands.py tests/test-fold.t tests/test-tutorial.t
diffstat 4 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/README	Sun Jul 23 16:39:21 2017 +0200
+++ b/README	Sun Jul 23 07:32:54 2017 +0200
@@ -126,6 +126,8 @@
 
   - amend: add a --extract flag to move change back to the working copy
     (same as uncommit, but accessible through the amend commit)
+  - uncommit: add support for --current-date and --current-user option
+  - fold: add support for --current-date and --current-user option
 
   - topic: add --age option to sort topic by the most recently touched,
   - topic: add a 't0' to access the root of a topic while keeping it active,
--- a/hgext3rd/evolve/evocommands.py	Sun Jul 23 16:39:21 2017 +0200
+++ b/hgext3rd/evolve/evocommands.py	Sun Jul 23 07:32:54 2017 +0200
@@ -316,7 +316,7 @@
     [('r', 'rev', [], _("revision to fold")),
      ('', 'exact', None, _("only fold specified revisions")),
      ('', 'from', None, _("fold revisions linearly to working copy parent"))
-    ] + commitopts + commitopts2,
+    ] + commitopts + commitopts2 + commitopts3,
     _('hg fold [OPTION]... [-r] REV'))
 def fold(ui, repo, *revs, **opts):
     """fold multiple revisions into a single one
@@ -355,6 +355,7 @@
 
          hg fold foo::@ --exact
     """
+    _resolveoptions(ui, opts)
     revs = list(revs)
     revs.extend(opts['rev'])
     if not revs:
--- a/tests/test-fold.t	Sun Jul 23 16:39:21 2017 +0200
+++ b/tests/test-fold.t	Sun Jul 23 07:32:54 2017 +0200
@@ -200,5 +200,21 @@
   o  0 - 1ea73414a91b r0 [debugbuilddag] (public)
   
 
+  $ hg fold --from 'desc("r4")' -U
+  2 changesets folded
+  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
+  $ hg log -G
+  @  15 - 91880abed0f2 r4 [test] (draft)
+  |
+  | o  12 - b568edbee6e0 r8 [debugbuilddag] (draft)
+  |/
+  o  3 - 2dc09a01254d r3 [debugbuilddag] (draft)
+  |
+  o  2 - 01241442b3c2 r2 [debugbuilddag] (draft)
+  |
+  o  1 - 66f7d451a68b r1 [debugbuilddag] (draft)
+  |
+  o  0 - 1ea73414a91b r0 [debugbuilddag] (public)
+  
   $ cd ..
 
--- a/tests/test-tutorial.t	Sun Jul 23 16:39:21 2017 +0200
+++ b/tests/test-tutorial.t	Sun Jul 23 07:32:54 2017 +0200
@@ -502,6 +502,8 @@
    -l --logfile FILE  read commit message from file
    -d --date DATE     record the specified date as commit date
    -u --user USER     record the specified user as committer
+   -D --current-date  record the current date as commit date
+   -U --current-user  record the current user as committer
   
   (some details hidden, use --verbose to show complete help)