inotify: add debugging mode to inotify
authorMatt Mackall <mpm@selenic.com>
Wed, 22 Oct 2008 19:40:32 -0500
changeset 7219 1f6d2e487135
parent 7218 1bd7f90465b3
child 7220 60826e071ce2
inotify: add debugging mode to inotify compare inotify results with dirstate results and report any changes return dirstate results for safety
hgext/inotify/__init__.py
--- a/hgext/inotify/__init__.py	Wed Oct 22 19:40:29 2008 -0500
+++ b/hgext/inotify/__init__.py	Wed Oct 22 19:40:32 2008 -0500
@@ -56,6 +56,18 @@
                 if not ignored and not self.inotifyserver:
                     result = client.query(ui, repo, files, match, False,
                                           clean, unknown)
+                    if ui.config('inotify', 'debug'):
+                        r2 = super(inotifydirstate, self).status(
+                            match, False, clean, unknown)
+                        for c,a,b in zip('LMARDUIC', result, r2):
+                            for f in a:
+                                if f not in b:
+                                    ui.warn('*** inotify: %s +%s\n' % (c, f))
+                            for f in b:
+                                if f not in a:
+                                    ui.warn('*** inotify: %S -%s\n' % (c, f))
+                        result = r2
+
                     if result is not None:
                         return result
             except (OSError, socket.error), err: