hgext/evolve.py
branchcompat-hg2.3
changeset 619 f50f8da7a077
parent 611 bd0f49f2ec83
child 620 232536f5c987
equal deleted inserted replaced
615:148bf61583f4 619:f50f8da7a077
  2189             tr.release()
  2189             tr.release()
  2190     finally:
  2190     finally:
  2191         lockmod.release(lock, wlock)
  2191         lockmod.release(lock, wlock)
  2192 
  2192 
  2193 @command('^fold',
  2193 @command('^fold',
  2194     [('r', 'rev', [], 'revisions to fold'),],
  2194     [('r', 'rev', [], 'revisions to fold'),
       
  2195     ],
  2195     # allow to choose the seed ?
  2196     # allow to choose the seed ?
  2196     _('[-r] revs'))
  2197     _('[-r] revs'))
  2197 def fold(ui, repo, *revs, **opts):
  2198 def fold(ui, repo, *revs, **opts):
  2198     """Fold multiple revisions into a single one"""
  2199     """Fold multiple revisions into a single one"""
  2199     revs = list(revs)
  2200     revs = list(revs)
  2220         tr = repo.transaction('touch')
  2221         tr = repo.transaction('touch')
  2221         try:
  2222         try:
  2222             allctx = [repo[r] for r in revs]
  2223             allctx = [repo[r] for r in revs]
  2223             targetphase = max(c.phase() for c in allctx)
  2224             targetphase = max(c.phase() for c in allctx)
  2224             msg = '\n\n***\n\n'.join(c.description() for c in allctx)
  2225             msg = '\n\n***\n\n'.join(c.description() for c in allctx)
       
  2226             commitopts = {'message': msg}
       
  2227             commitopts['edit'] = True
  2225             newid, _ = rewrite(repo, root, allctx, head,
  2228             newid, _ = rewrite(repo, root, allctx, head,
  2226                              [root.p1().node(), root.p2().node()],
  2229                              [root.p1().node(), root.p2().node()],
  2227                              commitopts={'message': msg})
  2230                              commitopts=commitopts)
  2228             phases.retractboundary(repo, targetphase, [newid])
  2231             phases.retractboundary(repo, targetphase, [newid])
  2229             createmarkers(repo, [(ctx, (repo[newid],))
  2232             createmarkers(repo, [(ctx, (repo[newid],))
  2230                                  for ctx in allctx])
  2233                                  for ctx in allctx])
  2231             tr.close()
  2234             tr.close()
  2232         finally:
  2235         finally: