equal
deleted
inserted
replaced
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): |