# HG changeset patch # User Patrick Mezard # Date 1336133992 -7200 # Node ID 2de6ac4ac17cc917a629e4fa6e4aad9f5e5b4abf # Parent 5516fdf3fe2483a157d7220beff22fa28934565b subrepo: ignore blank lines in .hgsubstate (issue3424) Reported by Sebastian Krysmanski diff -r 5516fdf3fe24 -r 2de6ac4ac17c mercurial/subrepo.py --- a/mercurial/subrepo.py Fri May 04 14:36:40 2012 -0400 +++ b/mercurial/subrepo.py Fri May 04 14:19:52 2012 +0200 @@ -44,6 +44,9 @@ if '.hgsubstate' in ctx: try: for l in ctx['.hgsubstate'].data().splitlines(): + l = l.lstrip() + if not l: + continue revision, path = l.split(" ", 1) rev[path] = revision except IOError, err: diff -r 5516fdf3fe24 -r 2de6ac4ac17c tests/test-subrepo-missing.t --- a/tests/test-subrepo-missing.t Fri May 04 14:36:40 2012 -0400 +++ b/tests/test-subrepo-missing.t Fri May 04 14:19:52 2012 +0200 @@ -12,6 +12,13 @@ adding b $ hg ci -m updatedsub +ignore blanklines in .hgsubstate + + >>> file('.hgsubstate', 'wb').write('\n\n \t \n \n') + $ hg st --subrepos + M .hgsubstate + $ hg revert -qC .hgsubstate + delete .hgsub and revert it $ rm .hgsub