mercurial/cmdutil.py
changeset 34055 ae92e5c0441c
parent 34029 6e6452bc441d
child 34056 7e9ccb1670e3
equal deleted inserted replaced
34054:3c82b14d2838 34055:ae92e5c0441c
  3171                 commitphase = old.phase()
  3171                 commitphase = old.phase()
  3172             repo.ui.setconfig('phases', 'new-commit', commitphase, 'amend')
  3172             repo.ui.setconfig('phases', 'new-commit', commitphase, 'amend')
  3173             newid = repo.commitctx(new)
  3173             newid = repo.commitctx(new)
  3174         finally:
  3174         finally:
  3175             repo.ui.setconfig('phases', 'new-commit', ph, 'amend')
  3175             repo.ui.setconfig('phases', 'new-commit', ph, 'amend')
  3176         if newid != old.node():
  3176 
  3177             # Reroute the working copy parent to the new changeset
  3177         # Reroute the working copy parent to the new changeset
  3178             repo.setparents(newid, nullid)
  3178         repo.setparents(newid, nullid)
  3179             mapping = {old.node(): (newid,)}
  3179         mapping = {old.node(): (newid,)}
  3180             if node:
  3180         if node:
  3181                 mapping[node] = ()
  3181             mapping[node] = ()
  3182             scmutil.cleanupnodes(repo, mapping, 'amend')
  3182         scmutil.cleanupnodes(repo, mapping, 'amend')
       
  3183 
  3183     return newid
  3184     return newid
  3184 
  3185 
  3185 def commiteditor(repo, ctx, subs, editform=''):
  3186 def commiteditor(repo, ctx, subs, editform=''):
  3186     if ctx.description():
  3187     if ctx.description():
  3187         return ctx.description()
  3188         return ctx.description()