comparison mercurial/wireproto.py @ 18280:47abbaabaaa5

clfilter: filter "unserved" on all wireprotocol command calls This ensures that unserved changesets are not exposed through the wire protocol.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Sun, 06 Jan 2013 04:37:33 +0100
parents 8474be4412ca
children 898c575833c9
comparison
equal deleted inserted replaced
18279:679767c38cb5 18280:47abbaabaaa5
344 class ooberror(object): 344 class ooberror(object):
345 def __init__(self, message): 345 def __init__(self, message):
346 self.message = message 346 self.message = message
347 347
348 def dispatch(repo, proto, command): 348 def dispatch(repo, proto, command):
349 repo = repo.filtered("unserved")
349 func, spec = commands[command] 350 func, spec = commands[command]
350 args = proto.getargs(spec) 351 args = proto.getargs(spec)
351 return func(repo, proto, *args) 352 return func(repo, proto, *args)
352 353
353 def options(cmd, keys, others): 354 def options(cmd, keys, others):
360 sys.stderr.write("abort: %s got unexpected arguments %s\n" 361 sys.stderr.write("abort: %s got unexpected arguments %s\n"
361 % (cmd, ",".join(others))) 362 % (cmd, ",".join(others)))
362 return opts 363 return opts
363 364
364 def batch(repo, proto, cmds, others): 365 def batch(repo, proto, cmds, others):
366 repo = repo.filtered("unserved")
365 res = [] 367 res = []
366 for pair in cmds.split(';'): 368 for pair in cmds.split(';'):
367 op, args = pair.split(' ', 1) 369 op, args = pair.split(' ', 1)
368 vals = {} 370 vals = {}
369 for a in args.split(','): 371 for a in args.split(','):