diff hgext/inotify/client.py @ 9351:206f7f4c5c2a

inotify: client: no repo use
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Mon, 29 Jun 2009 01:27:34 +0900
parents 5d8021ac0e19
children 4c041f1ee1b4
line wrap: on
line diff
--- a/hgext/inotify/client.py	Mon Jun 29 01:09:33 2009 +0900
+++ b/hgext/inotify/client.py	Mon Jun 29 01:27:34 2009 +0900
@@ -29,12 +29,12 @@
             if err[0] == errno.ECONNREFUSED:
                 self.ui.warn(_('(found dead inotify server socket; '
                                'removing it)\n'))
-                os.unlink(self.repo.join('inotify.sock'))
+                os.unlink(os.path.join(self.root, '.hg', 'inotify.sock'))
             if err[0] in (errno.ECONNREFUSED, errno.ENOENT) and autostart:
                 self.ui.debug(_('(starting inotify server)\n'))
                 try:
                     try:
-                        server.start(self.ui, self.repo)
+                        server.start(self.ui, self.dirstate, self.root)
                     except server.AlreadyStartedException, inst:
                         # another process may have started its own
                         # inotify server while this one was starting.
@@ -64,11 +64,12 @@
 class client(object):
     def __init__(self, ui, repo):
         self.ui = ui
-        self.repo = repo
+        self.dirstate = repo.dirstate
+        self.root = repo.root
         self.sock = socket.socket(socket.AF_UNIX)
 
     def _connect(self):
-        sockpath = self.repo.join('inotify.sock')
+        sockpath = os.path.join(self.root, '.hg', 'inotify.sock')
         try:
             self.sock.connect(sockpath)
         except socket.error, err: