diff -r 6b3d31d04a69 -r 58edd786e96f mercurial/phases.py --- a/mercurial/phases.py Sat May 12 00:24:07 2012 +0200 +++ b/mercurial/phases.py Sat May 12 00:24:07 2012 +0200 @@ -101,6 +101,7 @@ import errno from node import nullid, nullrev, bin, hex, short from i18n import _ +import util allphases = public, draft, secret = range(3) trackedphases = allphases[1:] @@ -250,6 +251,8 @@ newroots = [n for n in nodes if self.phase(repo, repo[n].rev()) < targetphase] if newroots: + if nullid in newroots: + raise util.Abort(_('cannot change null revision phase')) currentroots = currentroots.copy() currentroots.update(newroots) ctxs = repo.set('roots(%ln::)', currentroots)