# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1397258669 14400 # Node ID 1ebe5c51919bfde2e7365ca1b5b91a94e64777b2 # Parent a0e7c38a9df07834d2a3a61d86f53d67e9b6b13a 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. diff --git a/README b/README --- a/README +++ b/README @@ -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 diff --git a/hgext/evolve.py b/hgext/evolve.py --- a/hgext/evolve.py +++ b/hgext/evolve.py @@ -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()], 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 < [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 diff --git a/tests/test-tutorial.t b/tests/test-tutorial.t --- a/tests/test-tutorial.t +++ b/tests/test-tutorial.t @@ -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