--- a/hgext/evolve.py Sun May 11 01:29:11 2014 -0700
+++ b/hgext/evolve.py Wed May 14 16:42:41 2014 -0700
@@ -2020,9 +2020,9 @@
finally:
lockmod.release(lock, wlock)
-@command('^fold',
+@command('^fold|squash',
[('r', 'rev', [], _("explicitly specify the full set of revision to fold")),
- ] + commitopts2,
+ ] + commitopts + commitopts2,
# allow to choose the seed ?
_('rev'))
def fold(ui, repo, *revs, **opts):
@@ -2066,11 +2066,16 @@
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['edit'] = True
+
+ if commitopts.get('message') or commitopts.get('logfile'):
+ commitopts['edit'] = False
+ else:
+ 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['edit'] = True
+
newid, _ = rewrite(repo, root, allctx, head,
[root.p1().node(), root.p2().node()],
commitopts=commitopts)