diff --git a/hgext/rebase.py b/hgext/rebase.py index 84d4a4ce45fd2dba5533a97f0b846a65f745219c_aGdleHQvcmViYXNlLnB5..2889d4574726546fefd0c22a5cfd0c23bd311a6c_aGdleHQvcmViYXNlLnB5 100644 --- a/hgext/rebase.py +++ b/hgext/rebase.py @@ -198,6 +198,15 @@ if not rebaseset: repo.ui.debug('base is ancestor of destination') result = None + elif not keepf and list(repo.set('first(children(%ld) - %ld)', + rebaseset, rebaseset)): + raise util.Abort( + _("can't remove original changesets with" + " unrebased descendants"), + hint=_('use --keep to keep original changesets')) + else: + result = buildstate(repo, dest, rebaseset, detachf) + if not result: # Empty state built, nothing to rebase ui.status(_('nothing to rebase\n'))