# HG changeset patch # User Peter Arrenbrecht # Date 2011-05-24 15:48:16 # Node ID 5adb525247791d367403ec34711eae1c2f028cea # Parent 5f6090e559fa0d4d5cba0d1baacb199682f2ac65 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. diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py --- a/mercurial/wireproto.py +++ b/mercurial/wireproto.py @@ -288,7 +288,7 @@ def lookup(repo, proto, key): success = 0 return "%s %s\n" % (success, r) -def known(repo, proto, nodes): +def known(repo, proto, nodes, others): return ''.join(b and "1" or "0" for b in repo.known(decodelist(nodes))) def pushkey(repo, proto, namespace, key, old, new): @@ -412,7 +412,7 @@ commands = { 'getbundle': (getbundle, '*'), 'heads': (heads, ''), 'hello': (hello, ''), - 'known': (known, 'nodes'), + 'known': (known, 'nodes *'), 'listkeys': (listkeys, 'namespace'), 'lookup': (lookup, 'key'), 'pushkey': (pushkey, 'namespace key old new'),