Mercurial > public > mercurial-scm > hg-stable
diff hgext/inotify/__init__.py @ 8555:3e09bc5fee12
inotify: introduce debuginotify, which lists which paths are under watch
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Wed, 22 Apr 2009 00:37:35 +0900 |
parents | 06561793778e |
children | f5fae700cc00 |
line wrap: on
line diff
--- 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]...')), }