changeset 915:1ebe5c51919b stable

fold: enable --date and --user options Like all other commit-creating commits, `hg fold` should also have these options enabled. This also allows getting consistent hashes during tests involving fold.
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Fri, 11 Apr 2014 19:24:29 -0400
parents a0e7c38a9df0
children 48e68d3b0144
files README hgext/evolve.py tests/test-evolve.t tests/test-tutorial.t
diffstat 4 files changed, 14 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/README	Wed Apr 23 14:15:40 2014 -0700
+++ b/README	Fri Apr 11 19:24:29 2014 -0400
@@ -48,6 +48,7 @@
 - active bookmark now move when using prev/next (#37)
 - fix some preservation of rename information on evolve (#33)
 - abort when evolve tries to move a node on top of itself (will helps on the #35 front)
+- fold: enable --date and --user options
 
 3.3.0 -- 2014-03-04
 
--- a/hgext/evolve.py	Wed Apr 23 14:15:40 2014 -0700
+++ b/hgext/evolve.py	Fri Apr 11 19:24:29 2014 -0400
@@ -1728,7 +1728,7 @@
 
 @command('^fold',
     [('r', 'rev', [], _("explicitly specify the full set of revision to fold")),
-    ],
+    ] + commitopts2,
     # allow to choose the seed ?
     _('rev'))
 def fold(ui, repo, *revs, **opts):
@@ -1769,12 +1769,13 @@
         lock = repo.lock()
         tr = repo.transaction('touch')
         try:
+            commitopts = opts.copy()
             allctx = [repo[r] for r in revs]
             targetphase = max(c.phase() for c in allctx)
             msgs = ["HG: This is a fold of %d changesets." % len(allctx)]
             msgs += ["HG: Commit message of changeset %s.\n\n%s\n" %
                      (c.rev(), c.description()) for c in allctx]
-            commitopts = {'message': "\n".join(msgs)}
+            commitopts['message'] = "\n".join(msgs)
             commitopts['edit'] = True
             newid, _ = rewrite(repo, root, allctx, head,
                              [root.p1().node(), root.p2().node()],
--- a/tests/test-evolve.t	Wed Apr 23 14:15:40 2014 -0700
+++ b/tests/test-evolve.t	Fri Apr 11 19:24:29 2014 -0400
@@ -1,6 +1,7 @@
   $ cat >> $HGRCPATH <<EOF
   > [defaults]
   > amend=-d "0 0"
+  > fold=-d "0 0"
   > [web]
   > push_ssl = false
   > allow_push = *
@@ -593,7 +594,7 @@
   2 changesets folded
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ glog
-  @  11:*@default(draft) add 1 (glob)
+  @  11:dd4682c1a481@default(draft) add 1
   |
   o  5:0b9e50c35132@default(draft) add 3
   |
@@ -615,16 +616,20 @@
 
   $ hg up 4
   0 files updated, 0 files merged, 2 files removed, 0 files unresolved
-  $ hg fold --rev 4::11
+  $ hg fold --rev 4::11 --user victor
   3 changesets folded
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ glog
-  @  12:*@default(draft) add 4 (glob)
+  @  12:d26d339c513f@default(draft) add 4
   |
   | o  1:73d38bb17fd7@default(draft) add 1
   |/
   o  0:8685c6d34325@default(draft) add 0
   
+  $ hg log --template '{rev}: {author}\n'
+  12: victor
+  1: test
+  0: test
   $ hg log -r 12 --template '{desc}\n'
   add 4
   
--- a/tests/test-tutorial.t	Wed Apr 23 14:15:40 2014 -0700
+++ b/tests/test-tutorial.t	Fri Apr 11 19:24:29 2014 -0400
@@ -479,6 +479,8 @@
   options:
   
    -r --rev VALUE [+] explicitly specify the full set of revision to fold
+   -d --date DATE     record the specified date as commit date
+   -u --user USER     record the specified user as committer
   
   [+] marked option can be specified multiple times