hgext/rebase.py
changeset 17027 6c05eebd9fab
parent 16867 1093ad1e8903
parent 17026 f8af57c00a29
child 17028 efd2e14f7235
equal deleted inserted replaced
17023:3e2d8120528b 17027:6c05eebd9fab
   566         raise util.Abort(_('no rebase in progress'))
   566         raise util.Abort(_('no rebase in progress'))
   567 
   567 
   568 def abort(repo, originalwd, target, state):
   568 def abort(repo, originalwd, target, state):
   569     'Restore the repository to its original state'
   569     'Restore the repository to its original state'
   570     dstates = [s for s in state.values() if s != nullrev]
   570     dstates = [s for s in state.values() if s != nullrev]
   571     if [d for d in dstates if not repo[d].mutable()]:
   571     immutable = [d for d in dstates if not repo[d].mutable()]
   572         repo.ui.warn(_("warning: immutable rebased changeset detected, "
   572     if immutable:
   573                        "can't abort\n"))
   573         raise util.Abort(_("can't abort rebase due to immutable changesets %s")
   574         return -1
   574                          % ', '.join(str(repo[r]) for r in immutable),
       
   575                          hint=_('see hg help phases for details'))
   575 
   576 
   576     descendants = set()
   577     descendants = set()
   577     if dstates:
   578     if dstates:
   578         descendants = set(repo.changelog.descendants(dstates))
   579         descendants = set(repo.changelog.descendants(dstates))
   579     if descendants - set(dstates):
   580     if descendants - set(dstates):