diff -r 2e47e461d2ca -r d259322a394b mercurial/dirstate.py --- a/mercurial/dirstate.py Fri Sep 05 15:36:56 2014 -0700 +++ b/mercurial/dirstate.py Fri Sep 05 11:37:44 2014 -0700 @@ -256,6 +256,10 @@ See localrepo.setparents() """ + if self._parentwriters == 0: + raise ValueError("cannot set dirstate parent without " + + " calling dirstate.begingparentchange") + self._dirty = self._dirtypl = True oldp2 = self._pl[1] self._pl = p1, p2