##// END OF EJS Templates
outgoing: pass a repo object to the constructor...
Pierre-Yves David -
r29804:7b9157aa default
parent child Browse files
Show More
@@ -985,7 +985,7 b' def computeoutgoing(repo, heads, common)'
985 common = [nullid]
985 common = [nullid]
986 if not heads:
986 if not heads:
987 heads = cl.heads()
987 heads = cl.heads()
988 return discovery.outgoing(cl, common, heads)
988 return discovery.outgoing(repo, common, heads)
989
989
990 def getchangegroup(repo, source, heads=None, common=None, bundlecaps=None,
990 def getchangegroup(repo, source, heads=None, common=None, bundlecaps=None,
991 version='01'):
991 version='01'):
@@ -76,10 +76,10 b' class outgoing(object):'
76 The sets are computed on demand from the heads, unless provided upfront
76 The sets are computed on demand from the heads, unless provided upfront
77 by discovery.'''
77 by discovery.'''
78
78
79 def __init__(self, revlog, commonheads, missingheads):
79 def __init__(self, repo, commonheads, missingheads):
80 self.commonheads = commonheads
80 self.commonheads = commonheads
81 self.missingheads = missingheads
81 self.missingheads = missingheads
82 self._revlog = revlog
82 self._revlog = repo.changelog
83 self._common = None
83 self._common = None
84 self._missing = None
84 self._missing = None
85 self.excluded = []
85 self.excluded = []
@@ -120,7 +120,7 b' def outgoingbetween(repo, roots, heads):'
120 csets, roots, heads = cl.nodesbetween(roots, heads)
120 csets, roots, heads = cl.nodesbetween(roots, heads)
121 included = set(csets)
121 included = set(csets)
122 discbases = [n for n in discbases if n not in included]
122 discbases = [n for n in discbases if n not in included]
123 return outgoing(cl, discbases, heads)
123 return outgoing(repo, discbases, heads)
124
124
125 def findcommonoutgoing(repo, other, onlyheads=None, force=False,
125 def findcommonoutgoing(repo, other, onlyheads=None, force=False,
126 commoninc=None, portable=False):
126 commoninc=None, portable=False):
@@ -137,7 +137,7 b' def findcommonoutgoing(repo, other, only'
137 If portable is given, compute more conservative common and missingheads,
137 If portable is given, compute more conservative common and missingheads,
138 to make bundles created from the instance more portable.'''
138 to make bundles created from the instance more portable.'''
139 # declare an empty outgoing object to be filled later
139 # declare an empty outgoing object to be filled later
140 og = outgoing(repo.changelog, None, None)
140 og = outgoing(repo, None, None)
141
141
142 # get common set if not provided
142 # get common set if not provided
143 if commoninc is None:
143 if commoninc is None:
@@ -112,7 +112,7 b' Create an extension to test bundle2 API'
112 > bundled = repo.revs('%ld::%ld', revs, revs)
112 > bundled = repo.revs('%ld::%ld', revs, revs)
113 > headmissing = [c.node() for c in repo.set('heads(%ld)', revs)]
113 > headmissing = [c.node() for c in repo.set('heads(%ld)', revs)]
114 > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
114 > headcommon = [c.node() for c in repo.set('parents(%ld) - %ld', revs, revs)]
115 > outgoing = discovery.outgoing(repo.changelog, headcommon, headmissing)
115 > outgoing = discovery.outgoing(repo, headcommon, headmissing)
116 > cg = changegroup.getlocalchangegroup(repo, 'test:bundle2', outgoing, None)
116 > cg = changegroup.getlocalchangegroup(repo, 'test:bundle2', outgoing, None)
117 > bundler.newpart('changegroup', data=cg.getchunks(),
117 > bundler.newpart('changegroup', data=cg.getchunks(),
118 > mandatory=False)
118 > mandatory=False)
General Comments 0
You need to be logged in to leave comments. Login now