hgext/inotify/__init__.py
changeset 8555 3e09bc5fee12
parent 8552 06561793778e
child 8556 f5fae700cc00
--- a/hgext/inotify/__init__.py	Wed Apr 22 00:23:40 2009 +0900
+++ b/hgext/inotify/__init__.py	Wed Apr 22 00:37:35 2009 +0900
@@ -39,6 +39,18 @@
     service = service()
     cmdutil.service(opts, initfn=service.init, runfn=service.run)
 
+def debuginotify(ui, repo, **opts):
+    '''debugging information for inotify extension
+
+    Prints the list of directories being watched by the inotify server.
+    '''
+    cli = client(ui, repo)
+    response = cli.debugquery()
+
+    ui.write(_('directories being watched:\n'))
+    for path in response:
+        ui.write(('  %s/\n') % path)
+
 def reposetup(ui, repo):
     if not hasattr(repo, 'dirstate'):
         return
@@ -82,11 +94,13 @@
     repo.dirstate.__class__ = inotifydirstate
 
 cmdtable = {
+    'debuginotify':
+        (debuginotify, [], ('hg debuginotify')),
     '^inserve':
-    (serve,
-     [('d', 'daemon', None, _('run server in background')),
-      ('', 'daemon-pipefds', '', _('used internally by daemon mode')),
-      ('t', 'idle-timeout', '', _('minutes to sit idle before exiting')),
-      ('', 'pid-file', '', _('name of file to write process ID to'))],
-     _('hg inserve [OPT]...')),
+        (serve,
+         [('d', 'daemon', None, _('run server in background')),
+          ('', 'daemon-pipefds', '', _('used internally by daemon mode')),
+          ('t', 'idle-timeout', '', _('minutes to sit idle before exiting')),
+          ('', 'pid-file', '', _('name of file to write process ID to'))],
+         _('hg inserve [OPT]...')),
     }