diff --git a/mercurial/dirstate.py b/mercurial/dirstate.py --- a/mercurial/dirstate.py +++ b/mercurial/dirstate.py @@ -66,6 +66,8 @@ class dirstate(object): syntaxes = {'re': 'relre:', 'regexp': 'relre:', 'glob': 'relglob:'} def parselines(fp): for line in fp: + if not line.endswith('\n'): + line += '\n' escape = False for i in xrange(len(line)): if escape: escape = False diff --git a/tests/test-hgignore b/tests/test-hgignore --- a/tests/test-hgignore +++ b/tests/test-hgignore @@ -1,6 +1,25 @@ #!/bin/sh hg init + +# Test issue 562: .hgignore requires newline at end +touch foo +touch bar +touch baz +cat > makeignore.py <