comparison mercurial/streamclone.py @ 48600:d9017df70135

stream-clone: filter possible missing requirements using all supported one The `supportedformat` requirements is missing some important requirements and it seems better to filter out with all requirements we know, not just an "arbitrary" subset. This is especially relevant as we about to phase out the `supportedformat` class attribute. (a backport of this change to stable should be sent soon). Differential Revision: https://phab.mercurial-scm.org/D12031
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Mon, 24 Jan 2022 11:49:06 +0100
parents 8475a1364909
children baddab229b86
comparison
equal deleted inserted replaced
48599:dfbfa802876b 48600:d9017df70135
126 ) 126 )
127 return False, None 127 return False, None
128 128
129 streamreqs = set(streamreqs.split(b',')) 129 streamreqs = set(streamreqs.split(b','))
130 # Server requires something we don't support. Bail. 130 # Server requires something we don't support. Bail.
131 missingreqs = streamreqs - repo.supportedformats 131 missingreqs = streamreqs - repo.supported
132 if missingreqs: 132 if missingreqs:
133 pullop.repo.ui.warn( 133 pullop.repo.ui.warn(
134 _( 134 _(
135 b'warning: stream clone requested but client is missing ' 135 b'warning: stream clone requested but client is missing '
136 b'requirements: %s\n' 136 b'requirements: %s\n'
501 raise error.Abort( 501 raise error.Abort(
502 _(b'cannot apply stream clone bundle on non-empty repo') 502 _(b'cannot apply stream clone bundle on non-empty repo')
503 ) 503 )
504 504
505 filecount, bytecount, requirements = readbundle1header(fp) 505 filecount, bytecount, requirements = readbundle1header(fp)
506 missingreqs = requirements - repo.supportedformats 506 missingreqs = requirements - repo.supported
507 if missingreqs: 507 if missingreqs:
508 raise error.Abort( 508 raise error.Abort(
509 _(b'unable to apply stream clone: unsupported format: %s') 509 _(b'unable to apply stream clone: unsupported format: %s')
510 % b', '.join(sorted(missingreqs)) 510 % b', '.join(sorted(missingreqs))
511 ) 511 )