comparison mercurial/changegroup.py @ 27734:5c0fd878779c

treemanifests: set bundle2 part parameter indicating treemanifest By adding a mandatory 'treemanifest' parameter in the bundle2 part, we make it possible for the recipient to set repo requirements before the manifest revlog is accessed.
author Martin von Zweigbergk <martinvonz@google.com>
date Fri, 08 Jan 2016 21:13:06 -0800
parents b0d23a55f91e
children bd37212c20ed
comparison
equal deleted inserted replaced
27733:3d1baa702d1a 27734:5c0fd878779c
1044 repo.ui.debug("adding %s revisions\n" % f) 1044 repo.ui.debug("adding %s revisions\n" % f)
1045 pr() 1045 pr()
1046 directory = (f[-1] == '/') 1046 directory = (f[-1] == '/')
1047 if directory: 1047 if directory:
1048 # a directory using treemanifests 1048 # a directory using treemanifests
1049 # TODO fixup repo requirements safely
1050 if 'treemanifest' not in repo.requirements:
1051 if not wasempty:
1052 raise error.Abort(_(
1053 "bundle contains tree manifests, but local repo is "
1054 "non-empty and does not use tree manifests"))
1055 repo.requirements.add('treemanifest')
1056 repo._applyopenerreqs()
1057 repo._writerequirements()
1058 repo.manifest._treeondisk = True
1059 repo.manifest._treeinmem = True
1060 fl = repo.manifest.dirlog(f) 1049 fl = repo.manifest.dirlog(f)
1061 else: 1050 else:
1062 fl = repo.file(f) 1051 fl = repo.file(f)
1063 o = len(fl) 1052 o = len(fl)
1064 try: 1053 try: