--- a/hgext/rebase.py Mon Dec 26 13:48:31 2011 +0100
+++ b/hgext/rebase.py Tue Dec 27 00:11:22 2011 +0100
@@ -193,6 +193,11 @@
rebaseset = repo.revs('(children(ancestor(%r, %d)) & ::%r)::',
base, dest, base)
+ if rebaseset:
+ root = min(rebaseset)
+ else:
+ root = None
+
if not rebaseset:
repo.ui.debug('base is ancestor of destination')
result = None
@@ -202,6 +207,10 @@
_("can't remove original changesets with"
" unrebased descendants"),
hint=_('use --keep to keep original changesets'))
+ elif not keepf and not repo[root].mutable():
+ raise util.Abort(_("Can't rebase immutable changeset %s")
+ % repo[root],
+ hint=_('see hg help phases for details'))
else:
result = buildstate(repo, dest, rebaseset, detachf)