[PATCH] Fixed issue 884: Build products not ignored until .hgignore touched

Renato Cunha renatoc at gmail.com
Mon Jul 5 16:48:25 CDT 2010


# HG changeset patch
# User Renato Cunha <renatoc at gmail.com>
# Date 1278366378 10800
# Node ID 186e2352fb57a1edbb6a4f9ae4e3e6c304873bb0
# Parent  c57cfff6f7b8c55637c05b169ab0d08474f0e513
Fixed issue 884: Build products not ignored until .hgignore touched

This is an attempt to fix issue 884. In summary, the bug was that "hg status"
displayed ignored files as untracked, instead of not displaying them. A new
test has been added to the main inotify test to prevent any regressions.

diff --git a/hgext/inotify/server.py b/hgext/inotify/server.py
--- a/hgext/inotify/server.py
+++ b/hgext/inotify/server.py
@@ -213,7 +213,7 @@
             if time != int(st_mtime):
                 return 'l'
             return 'n'
-        if type_ == '?' and self.dirstate._ignore(fn):
+        if type_ == '?' and self.dirstate._dirignore(fn):
             return 'i'
         return type_
 
diff --git a/tests/test-inotify b/tests/test-inotify
--- a/tests/test-inotify
+++ b/tests/test-inotify
@@ -97,4 +97,17 @@
 echo b >> 1844/foo
 hg ci 1844 -m 'broken'
 
+# Test for issue884: "Build products not ignored until .hgignore is touched"
+echo '^build$' > .hgignore
+hg add .hgignore
+hg ci .hgignore -m 'ignorelist'
+
+# Now, lets add some build products...
+mkdir build
+touch build/x
+touch build/y
+
+# build/x & build/y shouldn't appear in "hg st"
+hg st
+
 kill `cat hg.pid`


More information about the Mercurial-devel mailing list