Patchwork [1,of,4,evolve-ext] fold: enable --date and --user options

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date April 12, 2014, 2:02 a.m.
Message ID <c5b806b24aadeb64ff32.1397268177@Iris>
Download mbox | patch
Permalink /patch/4295/
State Not Applicable
Headers show

Comments

Jordi Gutiérrez Hermoso - April 12, 2014, 2:02 a.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1397258669 14400
#      Fri Apr 11 19:24:29 2014 -0400
# Branch stable
# Node ID c5b806b24aadeb64ff32476b850d521f0bc37bef
# Parent  12ed6dfa8eead0deb3b3062df1466e63c1e54640
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.
Pierre-Yves David - April 14, 2014, 3:19 p.m.
On 04/11/2014 10:02 PM, Jordi Gutiérrez Hermoso wrote:
> # HG changeset patch
> # User Jordi Gutiérrez Hermoso <jordigh@octave.org>
> # Date 1397258669 14400
> #      Fri Apr 11 19:24:29 2014 -0400
> # Branch stable
> # Node ID c5b806b24aadeb64ff32476b850d521f0bc37bef
> # Parent  12ed6dfa8eead0deb3b3062df1466e63c1e54640
> 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.

Cool patches, but you do not seems to be testing --user.

Patch

diff --git a/hgext/evolve.py b/hgext/evolve.py
--- a/hgext/evolve.py
+++ b/hgext/evolve.py
@@ -1722,7 +1722,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):
@@ -1763,12 +1763,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()],
diff --git a/tests/test-evolve.t b/tests/test-evolve.t
--- a/tests/test-evolve.t
+++ b/tests/test-evolve.t
@@ -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
   |
@@ -619,7 +620,7 @@ 
   3 changesets folded
   2 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ glog
-  @  12:*@default(draft) add 4 (glob)
+  @  12:c3cfb9017ff6@default(draft) add 4
   |
   | o  1:73d38bb17fd7@default(draft) add 1
   |/