changeset 4440: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 2d3379c598c1 30e7aa755efd
files mercurial/dirstate.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Sat May 19 22:46:59 2007 +0200
+++ b/mercurial/dirstate.py	Sat May 19 22:47:01 2007 +0200
@@ -65,6 +65,8 @@
         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