localrepo: move the changegroupinfo method in changegroup module
This is a gratuitous code move aimed at reducing the localrepo bloatness.
The method had a single caller... already in this changegroup module.
--- a/mercurial/changegroup.py Tue Apr 01 13:59:55 2014 -0700
+++ b/mercurial/changegroup.py Tue Apr 01 14:13:34 2014 -0700
@@ -429,6 +429,14 @@
# do nothing with basenode, it is implicitly the previous one in HG10
return struct.pack(self.deltaheader, node, p1n, p2n, linknode)
+def _changegroupinfo(repo, nodes, source):
+ if repo.ui.verbose or source == 'bundle':
+ repo.ui.status(_("%d changesets found\n") % len(nodes))
+ if repo.ui.debugflag:
+ repo.ui.debug("list of changesets:\n")
+ for node in nodes:
+ repo.ui.debug("%s\n" % hex(node))
+
def getsubset(repo, outgoing, bundler, source, fastpath=False):
repo = repo.unfiltered()
commonrevs = outgoing.common
@@ -442,6 +450,6 @@
repo.filtername is None and heads == sorted(repo.heads()))
repo.hook('preoutgoing', throw=True, source=source)
- repo.changegroupinfo(csets, source)
+ _changegroupinfo(repo, csets, source)
gengroup = bundler.generate(commonrevs, csets, fastpathlinkrev, source)
return unbundle10(util.chunkbuffer(gengroup), 'UN')
--- a/mercurial/localrepo.py Tue Apr 01 13:59:55 2014 -0700
+++ b/mercurial/localrepo.py Tue Apr 01 14:13:34 2014 -0700
@@ -1683,14 +1683,6 @@
def push(self, remote, force=False, revs=None, newbranch=False):
return exchange.push(self, remote, force, revs, newbranch)
- def changegroupinfo(self, nodes, source):
- if self.ui.verbose or source == 'bundle':
- self.ui.status(_("%d changesets found\n") % len(nodes))
- if self.ui.debugflag:
- self.ui.debug("list of changesets:\n")
- for node in nodes:
- self.ui.debug("%s\n" % hex(node))
-
def changegroupsubset(self, roots, heads, source):
"""Compute a changegroup consisting of all the nodes that are
descendants of any of the roots and ancestors of any of the heads.