changeset 6479:31abcae33b4f

dirstate: do not ignore current directory '.' (issue 1078)
author Patrick Mezard <pmezard@gmail.com>
date Sat, 05 Apr 2008 18:15:04 +0200
parents 6ed371423d34
children ee7762515a41 960bc707ea10
files mercurial/dirstate.py tests/test-hgignore tests/test-hgignore.out
diffstat 3 files changed, 12 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/dirstate.py	Fri Apr 04 23:13:32 2008 +0200
+++ b/mercurial/dirstate.py	Sat Apr 05 18:15:04 2008 +0200
@@ -407,6 +407,8 @@
         return False
 
     def _dirignore(self, f):
+        if f == '.':
+            return False
         if self._ignore(f):
             return True
         for c in strutil.findall(f, '/'):
--- a/tests/test-hgignore	Fri Apr 04 23:13:32 2008 +0200
+++ b/tests/test-hgignore	Sat Apr 05 18:15:04 2008 +0200
@@ -40,6 +40,10 @@
 echo ".*\.o" > .hgignore
 echo "--" ; hg status
 
+# Check it does not ignore the current directory '.'
+echo "^\." > .hgignore
+echo "--" ; hg status
+
 echo "glob:**.o" > .hgignore
 echo "--" ; hg status
 
--- a/tests/test-hgignore.out	Fri Apr 04 23:13:32 2008 +0200
+++ b/tests/test-hgignore.out	Sat Apr 05 18:15:04 2008 +0200
@@ -15,6 +15,12 @@
 ? syntax
 --
 A dir/b.o
+? a.c
+? a.o
+? dir/c.o
+? syntax
+--
+A dir/b.o
 ? .hgignore
 ? a.c
 ? syntax