comparison mercurial/localrepo.py @ 14144:3c3c53d8343a

unbundler: separate delta and header parsing Add header parsing for changelog and manifest (currently no headers might change for next-gen bundle).
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Sat, 30 Apr 2011 19:01:24 +0200
parents 7f45b1911893
children 497493b777ad
comparison
equal deleted inserted replaced
14143:da635d3c5620 14144:3c3c53d8343a
1710 total=self.total) 1710 total=self.total)
1711 self.count += 1 1711 self.count += 1
1712 pr = prog() 1712 pr = prog()
1713 source.callback = pr 1713 source.callback = pr
1714 1714
1715 source.changelogheader()
1715 if (cl.addgroup(source, csmap, trp) is None 1716 if (cl.addgroup(source, csmap, trp) is None
1716 and not emptyok): 1717 and not emptyok):
1717 raise util.Abort(_("received changelog group is empty")) 1718 raise util.Abort(_("received changelog group is empty"))
1718 clend = len(cl) 1719 clend = len(cl)
1719 changesets = clend - clstart 1720 changesets = clend - clstart
1729 pr.total = changesets # manifests <= changesets 1730 pr.total = changesets # manifests <= changesets
1730 # no need to check for empty manifest group here: 1731 # no need to check for empty manifest group here:
1731 # if the result of the merge of 1 and 2 is the same in 3 and 4, 1732 # if the result of the merge of 1 and 2 is the same in 3 and 4,
1732 # no new manifest will be created and the manifest group will 1733 # no new manifest will be created and the manifest group will
1733 # be empty during the pull 1734 # be empty during the pull
1735 source.manifestheader()
1734 self.manifest.addgroup(source, revmap, trp) 1736 self.manifest.addgroup(source, revmap, trp)
1735 self.ui.progress(_('manifests'), None) 1737 self.ui.progress(_('manifests'), None)
1736 1738
1737 needfiles = {} 1739 needfiles = {}
1738 if self.ui.configbool('server', 'validate', default=False): 1740 if self.ui.configbool('server', 'validate', default=False):
1750 pr.count = 1 1752 pr.count = 1
1751 pr.total = efiles 1753 pr.total = efiles
1752 source.callback = None 1754 source.callback = None
1753 1755
1754 while 1: 1756 while 1:
1755 f = source.chunk() 1757 chunkdata = source.filelogheader()
1756 if not f: 1758 if not chunkdata:
1757 break 1759 break
1760 f = chunkdata["filename"]
1758 self.ui.debug("adding %s revisions\n" % f) 1761 self.ui.debug("adding %s revisions\n" % f)
1759 pr() 1762 pr()
1760 fl = self.file(f) 1763 fl = self.file(f)
1761 o = len(fl) 1764 o = len(fl)
1762 if fl.addgroup(source, revmap, trp) is None: 1765 if fl.addgroup(source, revmap, trp) is None: