changeset 29804:7b9157aa752f

outgoing: pass a repo object to the constructor We are to introduce more code constructing such object in the code base. It will be more convenient to pass a repository object, all current users already operate at the repository level anyway. More changes to the contructor argument are coming in later changeset.
author Pierre-Yves David <pierre-yves.david@ens-lyon.org>
date Tue, 09 Aug 2016 15:26:53 +0200
parents dab7069fc2bd
children f09d0004481c
files mercurial/changegroup.py mercurial/discovery.py tests/test-bundle2-format.t
diffstat 3 files changed, 6 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/changegroup.py	Tue Aug 16 08:21:16 2016 +0000
+++ b/mercurial/changegroup.py	Tue Aug 09 15:26:53 2016 +0200
@@ -985,7 +985,7 @@
         common = [nullid]
     if not heads:
         heads = cl.heads()
-    return discovery.outgoing(cl, common, heads)
+    return discovery.outgoing(repo, common, heads)
 
 def getchangegroup(repo, source, heads=None, common=None, bundlecaps=None,
                    version='01'):
--- a/mercurial/discovery.py	Tue Aug 16 08:21:16 2016 +0000
+++ b/mercurial/discovery.py	Tue Aug 09 15:26:53 2016 +0200
@@ -76,10 +76,10 @@
     The sets are computed on demand from the heads, unless provided upfront
     by discovery.'''
 
-    def __init__(self, revlog, commonheads, missingheads):
+    def __init__(self, repo, commonheads, missingheads):
         self.commonheads = commonheads
         self.missingheads = missingheads
-        self._revlog = revlog
+        self._revlog = repo.changelog
         self._common = None
         self._missing = None
         self.excluded = []
@@ -120,7 +120,7 @@
     csets, roots, heads = cl.nodesbetween(roots, heads)
     included = set(csets)
     discbases = [n for n in discbases if n not in included]
-    return outgoing(cl, discbases, heads)
+    return outgoing(repo, discbases, heads)
 
 def findcommonoutgoing(repo, other, onlyheads=None, force=False,
                        commoninc=None, portable=False):
@@ -137,7 +137,7 @@
     If portable is given, compute more conservative common and missingheads,
     to make bundles created from the instance more portable.'''
     # declare an empty outgoing object to be filled later
-    og = outgoing(repo.changelog, None, None)
+    og = outgoing(repo, None, None)
 
     # get common set if not provided
     if commoninc is None:
--- a/tests/test-bundle2-format.t	Tue Aug 16 08:21:16 2016 +0000
+++ b/tests/test-bundle2-format.t	Tue Aug 09 15:26:53 2016 +0200
@@ -112,7 +112,7 @@
   >             bundled = repo.revs('%ld::%ld', revs, revs)
   >             headmissing = [c.node() for c in repo.set('heads(%ld)', revs)]
   >             headcommon  = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
-  >             outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
+  >             outgoing = discovery.outgoing(repo, headcommon, headmissing)
   >             cg = changegroup.getlocalchangegroup(repo, 'test:bundle2', outgoing, None)
   >             bundler.newpart('changegroup', data=cg.getchunks(),
   >                             mandatory=False)