Mercurial > hg
comparison 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 |
comparison
equal
deleted
inserted
replaced
8552:06561793778e | 8553:e387ecd7a6ed |
---|---|
592 if version != common.version: | 592 if version != common.version: |
593 self.ui.warn(_('received query from incompatible client ' | 593 self.ui.warn(_('received query from incompatible client ' |
594 'version %d\n') % version) | 594 'version %d\n') % version) |
595 return | 595 return |
596 | 596 |
597 type = cs.read(4) | |
598 | |
597 names = cs.read().split('\0') | 599 names = cs.read().split('\0') |
598 | 600 |
599 states = names.pop() | 601 states = names.pop() |
600 | 602 |
601 self.ui.note(_('answering query for %r\n') % states) | 603 self.ui.note(_('answering query for %r\n') % states) |
636 | 638 |
637 try: | 639 try: |
638 try: | 640 try: |
639 v = chr(common.version) | 641 v = chr(common.version) |
640 | 642 |
641 sock.sendall(v + struct.pack(common.resphdrfmts['STAT'], | 643 sock.sendall(v + type + struct.pack(common.resphdrfmts[type], |
642 *map(len, results))) | 644 *map(len, results))) |
643 sock.sendall(''.join(results)) | 645 sock.sendall(''.join(results)) |
644 finally: | 646 finally: |
645 sock.shutdown(socket.SHUT_WR) | 647 sock.shutdown(socket.SHUT_WR) |
646 except socket.error, err: | 648 except socket.error, err: |
647 if err[0] != errno.EPIPE: | 649 if err[0] != errno.EPIPE: |