Patchwork [3,of,8] localrepo: call changegroupsubset() directly

login
register
mail settings
Submitter Gregory Szorc
Date Aug. 5, 2016, 3:16 a.m.
Message ID <3113726903b529dfb7de.1470367019@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/16107/
State Accepted
Headers show

Comments

Gregory Szorc - Aug. 5, 2016, 3:16 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1470366183 25200
#      Thu Aug 04 20:03:03 2016 -0700
# Node ID 3113726903b529dfb7defa3c0daddd7dd57484ee
# Parent  19d16c9bce2fdf86d8c84915a45815bb7d4fd932
localrepo: call changegroupsubset() directly

changegroup.changegroup() is a one-line function that simply calls
changegroup.changegroupsubset() with repo.heads() as an additional
argument. The function adds little value. So we prepare for removing
it by converting a caller to use changegroupsubset() directly.

Patch

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -221,17 +221,18 @@  class locallegacypeer(localpeer):
 
     def branches(self, nodes):
         return self._repo.branches(nodes)
 
     def between(self, pairs):
         return self._repo.between(pairs)
 
     def changegroup(self, basenodes, source):
-        return changegroup.changegroup(self._repo, basenodes, source)
+        return changegroup.changegroupsubset(self._repo, basenodes,
+                                             self._repo.heads(), source)
 
     def changegroupsubset(self, bases, heads, source):
         return changegroup.changegroupsubset(self._repo, bases, heads, source)
 
 class localrepository(object):
 
     supportedformats = set(('revlogv1', 'generaldelta', 'treemanifest',
                             'manifestv2'))