mercurial/phases.py
changeset 16659 58edd786e96f
parent 16658 6b3d31d04a69
child 16724 00535da82faf
--- 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)