Show More
@@ -117,8 +117,7 b' def writerevs(ui, r1, r2, order, tr):' | |||
|
117 | 117 | |
|
118 | 118 | try: |
|
119 | 119 | group = util.chunkbuffer(r1.group(order, lookup, progress)) |
|
120 | chunkiter = changegroup.chunkiter(group) | |
|
121 | r2.addgroup(chunkiter, unlookup, tr) | |
|
120 | r2.addgroup(group.chunks(), unlookup, tr) | |
|
122 | 121 | finally: |
|
123 | 122 | ui.progress(_('writing'), None) |
|
124 | 123 |
@@ -33,7 +33,7 b' class bundlerevlog(revlog.revlog):' | |||
|
33 | 33 | self.bundle = bundle |
|
34 | 34 | self.basemap = {} |
|
35 | 35 | def chunkpositer(): |
|
36 |
for chunk in |
|
|
36 | for chunk in bundle.chunks(): | |
|
37 | 37 | pos = bundle.tell() |
|
38 | 38 | yield chunk, pos - len(chunk) |
|
39 | 39 | n = len(self) |
@@ -226,11 +226,11 b' class bundlerepository(localrepo.localre' | |||
|
226 | 226 | if not self.bundlefilespos: |
|
227 | 227 | self.bundle.seek(self.filestart) |
|
228 | 228 | while 1: |
|
229 |
chunk = |
|
|
229 | chunk = self.bundle.chunk() | |
|
230 | 230 | if not chunk: |
|
231 | 231 | break |
|
232 | 232 | self.bundlefilespos[chunk] = self.bundle.tell() |
|
233 |
for c in |
|
|
233 | for c in self.bundle.chunks(): | |
|
234 | 234 | pass |
|
235 | 235 | |
|
236 | 236 | if f[0] == '/': |
@@ -150,6 +150,10 b' class unbundle10(object):' | |||
|
150 | 150 | return self._stream.seek(pos) |
|
151 | 151 | def tell(self): |
|
152 | 152 | return self._stream.tell() |
|
153 | def chunks(self, progress=None): | |
|
154 | return chunkiter(self, progress) | |
|
155 | def chunk(self): | |
|
156 | return getchunk(self) | |
|
153 | 157 | |
|
154 | 158 | class headerlessfixup(object): |
|
155 | 159 | def __init__(self, fh, h): |
@@ -1644,6 +1644,9 b' class localrepository(repo.repository):' | |||
|
1644 | 1644 | if not source: |
|
1645 | 1645 | return 0 |
|
1646 | 1646 | |
|
1647 | if not hasattr(source, 'chunk'): | |
|
1648 | source = changegroup.unbundle10(source, 'UN') | |
|
1649 | ||
|
1647 | 1650 | self.hook('prechangegroup', throw=True, source=srctype, url=url) |
|
1648 | 1651 | |
|
1649 | 1652 | changesets = files = revisions = 0 |
@@ -1671,8 +1674,8 b' class localrepository(repo.repository):' | |||
|
1671 | 1674 | total=self.total) |
|
1672 | 1675 | self.count += 1 |
|
1673 | 1676 | pr = prog() |
|
1674 | chunkiter = changegroup.chunkiter(source, progress=pr) | |
|
1675 | if cl.addgroup(chunkiter, csmap, trp) is None and not emptyok: | |
|
1677 | if (cl.addgroup(source.chunks(pr), csmap, trp) is None | |
|
1678 | and not emptyok): | |
|
1676 | 1679 | raise util.Abort(_("received changelog group is empty")) |
|
1677 | 1680 | clend = len(cl) |
|
1678 | 1681 | changesets = clend - clstart |
@@ -1686,12 +1689,11 b' class localrepository(repo.repository):' | |||
|
1686 | 1689 | pr.step = _('manifests') |
|
1687 | 1690 | pr.count = 1 |
|
1688 | 1691 | pr.total = changesets # manifests <= changesets |
|
1689 | chunkiter = changegroup.chunkiter(source, progress=pr) | |
|
1690 | 1692 | # no need to check for empty manifest group here: |
|
1691 | 1693 | # if the result of the merge of 1 and 2 is the same in 3 and 4, |
|
1692 | 1694 | # no new manifest will be created and the manifest group will |
|
1693 | 1695 | # be empty during the pull |
|
1694 |
self.manifest.addgroup( |
|
|
1696 | self.manifest.addgroup(source.chunks(pr), revmap, trp) | |
|
1695 | 1697 | self.ui.progress(_('manifests'), None) |
|
1696 | 1698 | |
|
1697 | 1699 | needfiles = {} |
@@ -1710,15 +1712,14 b' class localrepository(repo.repository):' | |||
|
1710 | 1712 | pr.count = 1 |
|
1711 | 1713 | pr.total = efiles |
|
1712 | 1714 | while 1: |
|
1713 |
f = c |
|
|
1715 | f = source.chunk() | |
|
1714 | 1716 | if not f: |
|
1715 | 1717 | break |
|
1716 | 1718 | self.ui.debug("adding %s revisions\n" % f) |
|
1717 | 1719 | pr() |
|
1718 | 1720 | fl = self.file(f) |
|
1719 | 1721 | o = len(fl) |
|
1720 | chunkiter = changegroup.chunkiter(source) | |
|
1721 | if fl.addgroup(chunkiter, revmap, trp) is None: | |
|
1722 | if fl.addgroup(source.chunks(), revmap, trp) is None: | |
|
1722 | 1723 | raise util.Abort(_("received file revlog group is empty")) |
|
1723 | 1724 | revisions += len(fl) - o |
|
1724 | 1725 | files += 1 |
General Comments 0
You need to be logged in to leave comments.
Login now