mercurial/cmdutil.py
branchstable
changeset 18197 153659e86a5f
parent 18006 0c10cf819146
child 18198 9b4adaef0db9
equal deleted inserted replaced
18194:18fef98618cd 18197:153659e86a5f
  1617 
  1617 
  1618 def amend(ui, repo, commitfunc, old, extra, pats, opts):
  1618 def amend(ui, repo, commitfunc, old, extra, pats, opts):
  1619     ui.note(_('amending changeset %s\n') % old)
  1619     ui.note(_('amending changeset %s\n') % old)
  1620     base = old.p1()
  1620     base = old.p1()
  1621 
  1621 
  1622     wlock = lock = None
  1622     wlock = lock = newid = None
  1623     try:
  1623     try:
  1624         wlock = repo.wlock()
  1624         wlock = repo.wlock()
  1625         lock = repo.lock()
  1625         lock = repo.lock()
  1626         tr = repo.transaction('amend')
  1626         tr = repo.transaction('amend')
  1627         try:
  1627         try:
  1780             if node:
  1780             if node:
  1781                 ui.note(_('stripping intermediate changeset %s\n') % ctx)
  1781                 ui.note(_('stripping intermediate changeset %s\n') % ctx)
  1782             ui.note(_('stripping amended changeset %s\n') % old)
  1782             ui.note(_('stripping amended changeset %s\n') % old)
  1783             repair.strip(ui, repo, old.node(), topic='amend-backup')
  1783             repair.strip(ui, repo, old.node(), topic='amend-backup')
  1784     finally:
  1784     finally:
       
  1785         if newid is None:
       
  1786             repo.dirstate.invalidate()
  1785         lockmod.release(wlock, lock)
  1787         lockmod.release(wlock, lock)
  1786     return newid
  1788     return newid
  1787 
  1789 
  1788 def commiteditor(repo, ctx, subs):
  1790 def commiteditor(repo, ctx, subs):
  1789     if ctx.description():
  1791     if ctx.description():