##// END OF EJS Templates
bundle2: add a 'stream' part handler for stream cloning...
Boris Feld -
r35776:b996ddf5 default
parent child Browse files
Show More
@@ -164,6 +164,7 b' from . import ('
164 164 phases,
165 165 pushkey,
166 166 pycompat,
167 streamclone,
167 168 tags,
168 169 url,
169 170 util,
@@ -2114,3 +2115,30 b' def bundle2getvars(op, part):'
2114 2115 key = "USERVAR_" + key
2115 2116 hookargs[key] = value
2116 2117 op.addhookargs(hookargs)
2118
2119 @parthandler('stream', ('requirements', 'filecount', 'bytecount', 'version'))
2120 def handlestreambundle(op, part):
2121
2122 version = part.params['version']
2123 if version != 'v2':
2124 raise error.Abort(_('unknown stream bundle version %s') % version)
2125 requirements = part.params['requirements'].split()
2126 filecount = int(part.params['filecount'])
2127 bytecount = int(part.params['bytecount'])
2128
2129 repo = op.repo
2130 if len(repo):
2131 msg = _('cannot apply stream clone to non empty repository')
2132 raise error.Abort(msg)
2133
2134 repo.ui.debug('applying stream bundle\n')
2135 streamclone.applybundlev2(repo, part, filecount, bytecount,
2136 requirements)
2137
2138 # new requirements = old non-format requirements +
2139 # new format-related remote requirements
2140 # requirements from the streamed-in repository
2141 repo.requirements = set(requirements) | (
2142 repo.requirements - repo.supportedformats)
2143 repo._applyopenerreqs()
2144 repo._writerequirements()
General Comments 0
You need to be logged in to leave comments. Login now