comparison 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
comparison
equal deleted inserted replaced
932:bcd0c12070b2 937:43cceb37324c
2018 finally: 2018 finally:
2019 tr.release() 2019 tr.release()
2020 finally: 2020 finally:
2021 lockmod.release(lock, wlock) 2021 lockmod.release(lock, wlock)
2022 2022
2023 @command('^fold', 2023 @command('^fold|squash',
2024 [('r', 'rev', [], _("explicitly specify the full set of revision to fold")), 2024 [('r', 'rev', [], _("explicitly specify the full set of revision to fold")),
2025 ] + commitopts2, 2025 ] + commitopts + commitopts2,
2026 # allow to choose the seed ? 2026 # allow to choose the seed ?
2027 _('rev')) 2027 _('rev'))
2028 def fold(ui, repo, *revs, **opts): 2028 def fold(ui, repo, *revs, **opts):
2029 """Fold multiple revisions into a single one 2029 """Fold multiple revisions into a single one
2030 2030
2064 tr = repo.transaction('touch') 2064 tr = repo.transaction('touch')
2065 try: 2065 try:
2066 commitopts = opts.copy() 2066 commitopts = opts.copy()
2067 allctx = [repo[r] for r in revs] 2067 allctx = [repo[r] for r in revs]
2068 targetphase = max(c.phase() for c in allctx) 2068 targetphase = max(c.phase() for c in allctx)
2069 msgs = ["HG: This is a fold of %d changesets." % len(allctx)] 2069
2070 msgs += ["HG: Commit message of changeset %s.\n\n%s\n" % 2070 if commitopts.get('message') or commitopts.get('logfile'):
2071 (c.rev(), c.description()) for c in allctx] 2071 commitopts['edit'] = False
2072 commitopts['message'] = "\n".join(msgs) 2072 else:
2073 commitopts['edit'] = True 2073 msgs = ["HG: This is a fold of %d changesets." % len(allctx)]
2074 msgs += ["HG: Commit message of changeset %s.\n\n%s\n" %
2075 (c.rev(), c.description()) for c in allctx]
2076 commitopts['message'] = "\n".join(msgs)
2077 commitopts['edit'] = True
2078
2074 newid, _ = rewrite(repo, root, allctx, head, 2079 newid, _ = rewrite(repo, root, allctx, head,
2075 [root.p1().node(), root.p2().node()], 2080 [root.p1().node(), root.p2().node()],
2076 commitopts=commitopts) 2081 commitopts=commitopts)
2077 phases.retractboundary(repo, targetphase, [newid]) 2082 phases.retractboundary(repo, targetphase, [newid])
2078 createmarkers(repo, [(ctx, (repo[newid],)) 2083 createmarkers(repo, [(ctx, (repo[newid],))