diff -r d8505bfe4825 -r a99931201d1b mercurial/subrepo.py --- a/mercurial/subrepo.py Sat Apr 25 23:54:31 2015 -0400 +++ b/mercurial/subrepo.py Fri Apr 24 23:23:55 2015 -0400 @@ -153,7 +153,8 @@ def writestate(repo, state): """rewrite .hgsubstate in (outer) repo with these subrepo states""" - lines = ['%s %s\n' % (state[s][1], s) for s in sorted(state)] + lines = ['%s %s\n' % (state[s][1], s) for s in sorted(state) + if state[s][1] != nullstate[1]] repo.wwrite('.hgsubstate', ''.join(lines), '') def submerge(repo, wctx, mctx, actx, overwrite):