[PATCH 3 of 3] inotify: completely ignore events on the repository root

Nicolas Dumazet nicdumz at gmail.com
Fri Dec 11 01:39:06 CST 2009


# HG changeset patch
# User Nicolas Dumazet <nicdumz.commits at gmail.com>
# Date 1260515859 -32400
# Node ID 0f736ebd60ec8da1cea905f98a985dd7252d10d7
# Parent  606bc8bd10a76a795017d61636e010aee7170420
inotify: completely ignore events on the repository root

They can only be events on the top directory object. Those events are
meaningless for us: permission changes, repository-wide moves...
And they break the assertion that all events happen in repo/*.
Just ignore them.

Fixes one of the failures of run-test.py --inotify test-permissions

diff --git a/hgext/inotify/linuxserver.py b/hgext/inotify/linuxserver.py
--- a/hgext/inotify/linuxserver.py
+++ b/hgext/inotify/linuxserver.py
@@ -335,6 +335,10 @@
             self.ui.note(_('%s reading %d events\n') %
                          (self.event_time(), len(events)))
         for evt in events:
+            if evt.fullpath == self.wprefix[:-1]:
+                # events on the root of the repository
+                # itself, e.g. permission changes or repository move
+                continue
             assert evt.fullpath.startswith(self.wprefix)
             wpath = evt.fullpath[self.prefixlen:]
 


More information about the Mercurial-devel mailing list