--- a/hgext/inotify/server.py Mon Jul 13 16:49:05 2009 +0200
+++ b/hgext/inotify/server.py Mon Jul 13 21:55:17 2009 +0900
@@ -636,6 +636,12 @@
assert evt.fullpath.startswith(self.wprefix)
wpath = evt.fullpath[len(self.wprefix):]
+ # paths have been normalized, wpath never ends with a '/'
+
+ if wpath.startswith('.hg/') and evt.mask & inotify.IN_ISDIR:
+ # ignore subdirectories of .hg/ (merge, patches...)
+ continue
+
if evt.mask & inotify.IN_UNMOUNT:
self.process_unmount(wpath, evt)
elif evt.mask & (inotify.IN_MODIFY | inotify.IN_ATTRIB):
--- a/tests/test-inotify Mon Jul 13 16:49:05 2009 +0200
+++ b/tests/test-inotify Mon Jul 13 21:55:17 2009 +0900
@@ -50,4 +50,24 @@
hg status
hg ci -m0
+# Test for issue1735: inotify watches files in .hg/merge
+hg st
+
+echo a > a
+
+hg ci -Am a
+hg st
+
+echo b >> a
+hg ci -m ab
+hg st
+
+echo c >> a
+hg st
+
+hg up 0
+hg st
+
+HGMERGE=internal:local hg up
+hg st
kill `cat hg.pid`
--- a/tests/test-inotify.out Mon Jul 13 16:49:05 2009 +0200
+++ b/tests/test-inotify.out Mon Jul 13 21:55:17 2009 +0900
@@ -38,3 +38,9 @@
removing h/h
A h
R h/h
+M a
+merging a
+1 files updated, 1 files merged, 2 files removed, 0 files unresolved
+M a
+3 files updated, 1 files merged, 0 files removed, 0 files unresolved
+M a