diff hgext/inotify/server.py @ 8553:e387ecd7a6ed

inotify: change protocol so that different query types can be supported.
author Nicolas Dumazet <nicdumz.commits@gmail.com>
date Fri, 17 Apr 2009 20:10:47 +0900
parents 4aad982111b6
children 47d7347484f5
line wrap: on
line diff
--- a/hgext/inotify/server.py	Tue Apr 07 19:30:01 2009 +0900
+++ b/hgext/inotify/server.py	Fri Apr 17 20:10:47 2009 +0900
@@ -594,6 +594,8 @@
                            'version %d\n') % version)
             return
 
+        type = cs.read(4)
+
         names = cs.read().split('\0')
 
         states = names.pop()
@@ -638,8 +640,8 @@
             try:
                 v = chr(common.version)
 
-                sock.sendall(v + struct.pack(common.resphdrfmts['STAT'],
-                                         *map(len, results)))
+                sock.sendall(v + type + struct.pack(common.resphdrfmts[type],
+                                            *map(len, results)))
                 sock.sendall(''.join(results))
             finally:
                 sock.shutdown(socket.SHUT_WR)