changeset 4444:2d32e3ae01a7

Fix issue 562: .hgignore requires newline at end. End-of-lines characters where discarded without any check for existence.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 19 May 2007 22:47:01 +0200
parents 4e521a3ee5eb
children 30e7aa755efd 2d3379c598c1
files mercurial/dirstate.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py
+++ b/mercurial/dirstate.py
@@ -65,6 +65,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