diff mercurial/wireproto.py @ 13720:9c4e04fe267e

debug: add debugwireargs to test argument passing over the wire Tests argument passing locally, via HTTP, and via SSH. This is mainly preparation for the next patch.
author Peter Arrenbrecht <peter.arrenbrecht@gmail.com>
date Tue, 22 Mar 2011 07:38:32 +0100
parents b3f9af7c22c5
children 3458c15ab2f0
line wrap: on
line diff
--- a/mercurial/wireproto.py	Tue Mar 22 07:37:56 2011 +0100
+++ b/mercurial/wireproto.py	Tue Mar 22 07:38:32 2011 +0100
@@ -133,6 +133,15 @@
             self.ui.status(_('remote: '), l)
         return ret
 
+    def debugwireargs(self, one, two, three=None, four=None):
+        # don't pass optional arguments left at their default value
+        opts = {}
+        if three is not None:
+            opts['three'] = three
+        if four is not None:
+            opts['four'] = four
+        return self._call('debugwireargs', one=one, two=two, **opts)
+
 # server side
 
 class streamres(object):
@@ -199,6 +208,9 @@
     cg = repo.changegroupsubset(bases, heads, 'serve')
     return streamres(proto.groupchunks(cg))
 
+def debugwireargs(repo, proto, one, two):
+    return repo.debugwireargs(one, two)
+
 def heads(repo, proto):
     h = repo.heads()
     return encodelist(h) + "\n"
@@ -343,6 +355,7 @@
     'capabilities': (capabilities, ''),
     'changegroup': (changegroup, 'roots'),
     'changegroupsubset': (changegroupsubset, 'bases heads'),
+    'debugwireargs': (debugwireargs, 'one two'),
     'heads': (heads, ''),
     'hello': (hello, ''),
     'listkeys': (listkeys, 'namespace'),