Mercurial > evolve
diff hgext/evolve.py @ 937:43cceb37324c
merge with 3.3.2
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Wed, 14 May 2014 16:42:41 -0700 |
parents | bcd0c12070b2 f13facb01ac5 |
children | 0523c7c63759 |
line wrap: on
line diff
--- 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)