D4209: changegroup: move manifest chunk emission to generate()
indygreg (Gregory Szorc)
phabricator at mercurial-scm.org
Thu Aug 9 22:24:30 EDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGc921ad9cae08: changegroup: move manifest chunk emission to generate() (authored by indygreg, committed by ).
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D4209?vs=10203&id=10233
REVISION DETAIL
https://phab.mercurial-scm.org/D4209
AFFECTED FILES
mercurial/changegroup.py
CHANGE DETAILS
diff --git a/mercurial/changegroup.py b/mercurial/changegroup.py
--- a/mercurial/changegroup.py
+++ b/mercurial/changegroup.py
@@ -871,11 +871,24 @@
fnodes = {} # needed file nodes
size = 0
- for chunk in self.generatemanifests(commonrevs, clrevorder,
- fastpathlinkrev, mfs, fnodes, source,
- clstate['clrevtomanifestrev']):
- size += len(chunk)
- yield chunk
+ it = self.generatemanifests(
+ commonrevs, clrevorder, fastpathlinkrev, mfs, fnodes, source,
+ clstate['clrevtomanifestrev'])
+
+ for dir, chunks in it:
+ if dir:
+ assert self.version == b'03'
+ chunk = _fileheader(dir)
+ size += len(chunk)
+ yield chunk
+
+ for chunk in chunks:
+ size += len(chunk)
+ yield chunk
+
+ close = closechunk()
+ size += len(close)
+ yield close
self._verbosenote(_('%8.i (manifests)\n') % size)
yield self._manifestsend
@@ -1053,11 +1066,6 @@
revs = _sortnodesnormal(store, prunednodes,
self._reorder)
- if dir:
- assert self.version == b'03'
- chunk = _fileheader(dir)
- yield chunk
-
it = deltagroup(
self._repo, revs, store, False, lookupfn,
self._deltaparentfn, self._builddeltaheader,
@@ -1067,11 +1075,7 @@
fullclnodes=self._fullclnodes,
precomputedellipsis=self._precomputedellipsis)
- for chunk in it:
- yield chunk
-
- close = closechunk()
- yield close
+ yield dir, it
# The 'source' parameter is useful for extensions
def generatefiles(self, changedfiles, commonrevs, source,
To: indygreg, #hg-reviewers
Cc: durin42, mercurial-devel
More information about the Mercurial-devel
mailing list