Mercurial > hg > mercurial-source
diff mercurial/subrepo.py @ 25082:a99931201d1b stable
subrepo: don't write .hgsubstate lines with empty subrepo state (issue4622)
The '' that is used to represent the state of a not-yet-committed
subrepo cannot be written to the file, because the code that parses
the file splits on ' ' and expects two parts.
Given that the .hgsubstate file is automatically rewritten on commit, it seems
a little strange that the file is written out during a merge.
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Fri, 24 Apr 2015 23:23:55 -0400 (2015-04-25) |
parents | 56e15db9109f |
children | 5df0aa7158ce 5135c2be6959 |
line wrap: on
line diff
--- a/mercurial/subrepo.py +++ b/mercurial/subrepo.py @@ -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):