comparison mercurial/wireproto.py @ 14436:5adb52524779

wireproto: enable optional args for known() for future extensibility Firstly, I think we should do this for all new wire commands, just to be on the safe side. So I want to get this into the 1.9 release. Secondly, there actually is potential here that sometimes the server can know that the number of its nodes which can possibly still be undecided on the client is small. It might then just send them along directly (cutting short the end game). This, however, requires walking the graph on the server, which can be expensive, so for the moment we're not actually doing it.
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Tue, 24 May 2011 17:48:16 +0200
parents ede7cea1550f
children 84094c0d2724
comparison
equal deleted inserted replaced
14435:5f6090e559fa 14436:5adb52524779
286 except Exception, inst: 286 except Exception, inst:
287 r = str(inst) 287 r = str(inst)
288 success = 0 288 success = 0
289 return "%s %s\n" % (success, r) 289 return "%s %s\n" % (success, r)
290 290
291 def known(repo, proto, nodes): 291 def known(repo, proto, nodes, others):
292 return ''.join(b and "1" or "0" for b in repo.known(decodelist(nodes))) 292 return ''.join(b and "1" or "0" for b in repo.known(decodelist(nodes)))
293 293
294 def pushkey(repo, proto, namespace, key, old, new): 294 def pushkey(repo, proto, namespace, key, old, new):
295 # compatibility with pre-1.8 clients which were accidentally 295 # compatibility with pre-1.8 clients which were accidentally
296 # sending raw binary nodes rather than utf-8-encoded hex 296 # sending raw binary nodes rather than utf-8-encoded hex
410 'changegroupsubset': (changegroupsubset, 'bases heads'), 410 'changegroupsubset': (changegroupsubset, 'bases heads'),
411 'debugwireargs': (debugwireargs, 'one two *'), 411 'debugwireargs': (debugwireargs, 'one two *'),
412 'getbundle': (getbundle, '*'), 412 'getbundle': (getbundle, '*'),
413 'heads': (heads, ''), 413 'heads': (heads, ''),
414 'hello': (hello, ''), 414 'hello': (hello, ''),
415 'known': (known, 'nodes'), 415 'known': (known, 'nodes *'),
416 'listkeys': (listkeys, 'namespace'), 416 'listkeys': (listkeys, 'namespace'),
417 'lookup': (lookup, 'key'), 417 'lookup': (lookup, 'key'),
418 'pushkey': (pushkey, 'namespace key old new'), 418 'pushkey': (pushkey, 'namespace key old new'),
419 'stream_out': (stream, ''), 419 'stream_out': (stream, ''),
420 'unbundle': (unbundle, 'heads'), 420 'unbundle': (unbundle, 'heads'),