changeset 4446:30e7aa755efd

Merge with crew-stable.
author Patrick Mezard <pmezard@gmail.com>
date Sat, 19 May 2007 22:51:43 +0200
parents af8db3b42a4a (current diff) 2d32e3ae01a7 (diff)
children 1b75e0eff532
files mercurial/dirstate.py
diffstat 3 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Thu May 17 20:09:52 2007 -0700
+++ b/mercurial/dirstate.py	Sat May 19 22:51:43 2007 +0200
@@ -66,6 +66,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
--- a/tests/test-hgignore	Thu May 17 20:09:52 2007 -0700
+++ b/tests/test-hgignore	Sat May 19 22:51:43 2007 +0200
@@ -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 <<EOF
+f = open(".hgignore", "w")
+f.write("ignore\n")
+f.write("foo\n")
+# No EOL here
+f.write("bar")
+f.close()
+EOF
+
+python makeignore.py
+echo % should display baz only
+hg status
+rm foo bar baz .hgignore makeignore.py
+
 touch a.o
 touch a.c
 touch syntax
--- a/tests/test-hgignore.out	Thu May 17 20:09:52 2007 -0700
+++ b/tests/test-hgignore.out	Sat May 19 22:51:43 2007 +0200
@@ -1,3 +1,5 @@
+% should display baz only
+? baz
 --
 A dir/b.o
 ? a.c