hgext/inotify/__init__.py
changeset 14945 11aad09a6370
parent 11321 40c06bbf58be
child 16683 525fdb738975
equal deleted inserted replaced
14944:e2c413bde8a5 14945:11aad09a6370
     9 '''accelerate status report using Linux's inotify service'''
     9 '''accelerate status report using Linux's inotify service'''
    10 
    10 
    11 # todo: socket permissions
    11 # todo: socket permissions
    12 
    12 
    13 from mercurial.i18n import _
    13 from mercurial.i18n import _
       
    14 from mercurial import util
    14 import server
    15 import server
    15 from client import client, QueryFailed
    16 from client import client, QueryFailed
    16 
    17 
    17 def serve(ui, repo, **opts):
    18 def serve(ui, repo, **opts):
    18     '''start an inotify server for this repository'''
    19     '''start an inotify server for this repository'''
    29     ui.write(_('directories being watched:\n'))
    30     ui.write(_('directories being watched:\n'))
    30     for path in response:
    31     for path in response:
    31         ui.write(('  %s/\n') % path)
    32         ui.write(('  %s/\n') % path)
    32 
    33 
    33 def reposetup(ui, repo):
    34 def reposetup(ui, repo):
    34     if not hasattr(repo, 'dirstate'):
    35     if not util.safehasattr(repo, 'dirstate'):
    35         return
    36         return
    36 
    37 
    37     class inotifydirstate(repo.dirstate.__class__):
    38     class inotifydirstate(repo.dirstate.__class__):
    38 
    39 
    39         # We'll set this to false after an unsuccessful attempt so that
    40         # We'll set this to false after an unsuccessful attempt so that