hgext/evolve.py
changeset 477 fded4d945f87
parent 470 a2dfe82f27a0
parent 476 f17a0f801e0b
child 481 4e0f1aae8d24
equal deleted inserted replaced
473:1f8f8dd75d18 477:fded4d945f87
   567 
   567 
   568     lock = repo.lock()
   568     lock = repo.lock()
   569     try:
   569     try:
   570         wlock = repo.wlock()
   570         wlock = repo.wlock()
   571         try:
   571         try:
       
   572             if old.phase() == phases.public:
       
   573                 raise util.Abort(_("can not rewrite immutable changeset %s")
       
   574                                  % old)
       
   575             if not repo.revs('%d and (::.)', old):
       
   576                 raise error.Abort(_('cannot amend non ancestor changeset'))
   572             tr = repo.transaction('amend')
   577             tr = repo.transaction('amend')
   573             try:
   578             try:
   574                 if old.phase() == phases.public:
       
   575                     raise util.Abort(_("can not rewrite immutable changeset %s")
       
   576                                      % old)
       
   577                 oldphase = old.phase()
   579                 oldphase = old.phase()
   578                 # commit current changes as update
   580                 # commit current changes as update
   579                 # code copied from commands.commit to avoid noisy messages
   581                 # code copied from commands.commit to avoid noisy messages
   580                 ciopts = dict(opts)
   582                 ciopts = dict(opts)
   581                 ciopts.pop('message', None)
   583                 ciopts.pop('message', None)