Patchwork [4,of,8] wireproto: call changegroupsubset() directly

login
register
mail settings
Submitter Gregory Szorc
Date Aug. 5, 2016, 3:17 a.m.
Message ID <2aef59d7c2ae22f6664b.1470367020@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/16108/
State Accepted
Headers show

Comments

Gregory Szorc - Aug. 5, 2016, 3:17 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1470366180 25200
#      Thu Aug 04 20:03:00 2016 -0700
# Node ID 2aef59d7c2ae22f6664b95f7d7f6ec385d2d1bab
# Parent  3113726903b529dfb7defa3c0daddd7dd57484ee
wireproto: call changegroupsubset() directly

changegroup.changegroup() is just a one-liner. Inline it.

Patch

diff --git a/mercurial/wireproto.py b/mercurial/wireproto.py
--- a/mercurial/wireproto.py
+++ b/mercurial/wireproto.py
@@ -710,17 +710,17 @@  def _capabilities(repo, proto):
 # `_capabilities` instead.
 @wireprotocommand('capabilities')
 def capabilities(repo, proto):
     return ' '.join(_capabilities(repo, proto))
 
 @wireprotocommand('changegroup', 'roots')
 def changegroup(repo, proto, roots):
     nodes = decodelist(roots)
-    cg = changegroupmod.changegroup(repo, nodes, 'serve')
+    cg = changegroupmod.changegroupsubset(repo, nodes, repo.heads(), 'serve')
     return streamres(proto.groupchunks(cg))
 
 @wireprotocommand('changegroupsubset', 'bases heads')
 def changegroupsubset(repo, proto, bases, heads):
     bases = decodelist(bases)
     heads = decodelist(heads)
     cg = changegroupmod.changegroupsubset(repo, bases, heads, 'serve')
     return streamres(proto.groupchunks(cg))