##// END OF EJS Templates
extensions: list up only enabled extensions, if "ui" is specified...
extensions: list up only enabled extensions, if "ui" is specified Before this patch, "extensions.extensions()" always lists up all loaded extensions. So, commands handling multiple repositories at a time like below enable extensions unexpectedly. - clone from or push to localhost: extensions enabled only in the source are enabled also in the destination - pull from localhost: extensions enabled only in the destination are enabled also in the source - recursive execution in subrepo tree: extensions enabled only in the parent or some of siblings in the tree are enabled also in others In addition to it, extensions disabled locally may be enabled unexpectedly. This patch checks whether each of extensions should be listed up or not, if "ui" is specified to "extensions.extensions()", and invokes "reposetup()" of each extensions only for repositories enabling it.

File last commit:

r10263:25e57239 stable
r19777:6f72e7d2 default
Show More
common.py
53 lines | 1.5 KiB | text/x-python | PythonLexer
# server.py - inotify common protocol code
#
# Copyright 2006, 2007, 2008 Bryan O'Sullivan <bos@serpentine.com>
# Copyright 2007, 2008 Brendan Cully <brendan@kublai.com>
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2 or any later version.
import cStringIO, socket, struct
"""
Protocol between inotify clients and server:
Client sending query:
1) send protocol version number
2) send query type (string, 4 letters long)
3) send query parameters:
- For STAT, N+1 \0-separated strings:
1) N different names that need checking
2) 1 string containing all the status types to match
- No parameter needed for DBUG
Server sending query answer:
1) send protocol version number
2) send query type
3) send struct.pack'ed headers describing the length of the content:
e.g. for STAT, receive 9 integers describing the length of the
9 \0-separated string lists to be read:
* one file list for each lmar!?ic status type
* one list containing the directories visited during lookup
"""
version = 3
resphdrfmts = {
'STAT': '>lllllllll', # status requests
'DBUG': '>l' # debugging queries
}
resphdrsizes = dict((k, struct.calcsize(v))
for k, v in resphdrfmts.iteritems())
def recvcs(sock):
cs = cStringIO.StringIO()
s = True
try:
while s:
s = sock.recv(65536)
cs.write(s)
finally:
sock.shutdown(socket.SHUT_RD)
cs.seek(0)
return cs