##// END OF EJS Templates
bundle-ng: move bundler creation up in the stack...
Benoit Boissinot -
r19199:d6d0f1ed default
parent child Browse files
Show More
@@ -117,7 +117,8 b' def writerevs(ui, r1, r2, order, tr):'
117 117 unlookup = lambda x: int(x, 10)
118 118
119 119 try:
120 bundler = changegroup.bundle10(lookup)
120 bundler = changegroup.bundle10()
121 bundler.start(lookup)
121 122 group = util.chunkbuffer(r1.group(order, bundler))
122 123 group = changegroup.unbundle10(group, "UN")
123 124 r2.addgroup(group, unlookup, tr)
@@ -225,7 +225,9 b' def readbundle(fh, fname):'
225 225
226 226 class bundle10(object):
227 227 deltaheader = _BUNDLE10_DELTA_HEADER
228 def __init__(self, lookup):
228 def __init__(self):
229 pass
230 def start(self, lookup):
229 231 self._lookup = lookup
230 232 def close(self):
231 233 return closechunk()
@@ -1840,7 +1840,9 b' class localrepository(object):'
1840 1840 if revs is None and not outgoing.excluded:
1841 1841 # push everything,
1842 1842 # use the fast path, no race possible on push
1843 cg = self._changegroup(outgoing.missing, 'push')
1843 bundler = changegroup.bundle10()
1844 cg = self._changegroup(outgoing.missing, bundler,
1845 'push')
1844 1846 else:
1845 1847 cg = self.getlocalbundle('push', outgoing)
1846 1848
@@ -1986,7 +1988,8 b' class localrepository(object):'
1986 1988 csets, bases, heads = cl.nodesbetween(bases, heads)
1987 1989 # We assume that all ancestors of bases are known
1988 1990 common = cl.ancestors([cl.rev(n) for n in bases])
1989 return self._changegroupsubset(common, csets, heads, source)
1991 bundler = changegroup.bundle10()
1992 return self._changegroupsubset(common, csets, heads, bundler, source)
1990 1993
1991 1994 def getlocalbundle(self, source, outgoing):
1992 1995 """Like getbundle, but taking a discovery.outgoing as an argument.
@@ -1995,9 +1998,11 b' class localrepository(object):'
1995 1998 precomputed sets in outgoing."""
1996 1999 if not outgoing.missing:
1997 2000 return None
2001 bundler = changegroup.bundle10()
1998 2002 return self._changegroupsubset(outgoing.common,
1999 2003 outgoing.missing,
2000 2004 outgoing.missingheads,
2005 bundler,
2001 2006 source)
2002 2007
2003 2008 def getbundle(self, source, heads=None, common=None):
@@ -2021,7 +2026,7 b' class localrepository(object):'
2021 2026 discovery.outgoing(cl, common, heads))
2022 2027
2023 2028 @unfilteredmethod
2024 def _changegroupsubset(self, commonrevs, csets, heads, source):
2029 def _changegroupsubset(self, commonrevs, csets, heads, bundler, source):
2025 2030
2026 2031 cl = self.changelog
2027 2032 mf = self.manifest
@@ -2034,7 +2039,7 b' class localrepository(object):'
2034 2039 # can we go through the fast path ?
2035 2040 heads.sort()
2036 2041 if heads == sorted(self.heads()):
2037 return self._changegroup(csets, source)
2042 return self._changegroup(csets, bundler, source)
2038 2043
2039 2044 # slow path
2040 2045 self.hook('preoutgoing', throw=True, source=source)
@@ -2076,7 +2081,7 b' class localrepository(object):'
2076 2081 unit=_files, total=count[1])
2077 2082 return fstate[1][x]
2078 2083
2079 bundler = changegroup.bundle10(lookup)
2084 bundler.start(lookup)
2080 2085 reorder = self.ui.config('bundle', 'reorder', 'auto')
2081 2086 if reorder == 'auto':
2082 2087 reorder = None
@@ -2133,7 +2138,7 b' class localrepository(object):'
2133 2138 return self.changegroupsubset(basenodes, self.heads(), source)
2134 2139
2135 2140 @unfilteredmethod
2136 def _changegroup(self, nodes, source):
2141 def _changegroup(self, nodes, bundler, source):
2137 2142 """Compute the changegroup of all nodes that we have that a recipient
2138 2143 doesn't. Return a chunkbuffer object whose read() method will return
2139 2144 successive changegroup chunks.
@@ -2184,7 +2189,7 b' class localrepository(object):'
2184 2189 total=count[1], unit=_files)
2185 2190 return cl.node(revlog.linkrev(revlog.rev(x)))
2186 2191
2187 bundler = changegroup.bundle10(lookup)
2192 bundler.start(lookup)
2188 2193 reorder = self.ui.config('bundle', 'reorder', 'auto')
2189 2194 if reorder == 'auto':
2190 2195 reorder = None
General Comments 0
You need to be logged in to leave comments. Login now