--- a/mercurial/wireproto.py Wed Jul 14 15:33:21 2010 -0500
+++ b/mercurial/wireproto.py Wed Jul 14 15:43:20 2010 -0500
@@ -15,7 +15,9 @@
return False
func, spec = commands[command]
args = proto.getargs(spec)
- proto.respond(func(repo, proto, *args))
+ r = func(repo, proto, *args)
+ if r != None:
+ proto.respond(r)
return True
def between(repo, proto, pairs):
@@ -41,6 +43,17 @@
r.append(" ".join(map(hex, b)) + "\n")
return "".join(r)
+def changegroup(repo, proto, roots):
+ nodes = map(bin, roots.split(" "))
+ cg = repo.changegroup(nodes, 'serve')
+ proto.sendchangegroup(cg)
+
+def changegroupsubset(repo, proto, bases, heads):
+ bases = [bin(n) for n in bases.split(' ')]
+ heads = [bin(n) for n in heads.split(' ')]
+ cg = repo.changegroupsubset(bases, heads, 'serve')
+ proto.sendchangegroup(cg)
+
def heads(repo, proto):
h = repo.heads()
return " ".join(map(hex, h)) + "\n"
@@ -68,6 +81,8 @@
'between': (between, 'pairs'),
'branchmap': (branchmap, ''),
'branches': (branches, 'nodes'),
+ 'changegroup': (changegroup, 'roots'),
+ 'changegroupsubset': (changegroupsubset, 'bases heads'),
'heads': (heads, ''),
'listkeys': (listkeys, 'namespace'),
'lookup': (lookup, 'key'),