Commits

Nicolas Dumazet  committed 153557e

+ test-permissions

  • Participants
  • Parent commits 9053d03

Comments (0)

Files changed (2)

File inotify-test-permissions

+From: Nicolas Dumazet <nicdumz.commits@gmail.com>
+inotify: fix path assertion
+
+Spotted in test-permissions when run with --inotify
+
+diff --git a/hgext/inotify/server.py b/hgext/inotify/server.py
+--- a/hgext/inotify/server.py
++++ b/hgext/inotify/server.py
+@@ -636,7 +636,10 @@
+             self.ui.note(_('%s reading %d events\n') %
+                          (self.event_time(), len(events)))
+         for evt in events:
+-            assert evt.fullpath.startswith(self.wprefix)
++            # event is either in a subdirectory of wprefix or the
++            # root itself
++            assert evt.fullpath.startswith(self.wprefix) or \
++                self.wprefix[:-1] == evt.fullpath
+             wpath = evt.fullpath[self.prefixlen:]
+ 
+             # paths have been normalized, wpath never ends with a '/'
 implicit-inotify
 pidfile
 runtest-inotify
+inotify-test-permissions
 pyfs
 separate
 activate-inot-mac