comparison mercurial/wireprototypes.py @ 50913:93b0de7f13ca

compression: use sysstr to specify attribute to fetch for priority These are attributes so they should be `str`.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 01 Sep 2023 12:11:11 +0200
parents 642e31cb55f0
children 18c8c18993f0
comparison
equal deleted inserted replaced
50912:f6cb926d4189 50913:93b0de7f13ca
365 config = b'experimental.clientcompressionengines' 365 config = b'experimental.clientcompressionengines'
366 366
367 # No explicit config. Filter out the ones that aren't supposed to be 367 # No explicit config. Filter out the ones that aren't supposed to be
368 # advertised and return default ordering. 368 # advertised and return default ordering.
369 if not configengines: 369 if not configengines:
370 attr = ( 370 attr = 'serverpriority' if role == util.SERVERROLE else 'clientpriority'
371 b'serverpriority' if role == util.SERVERROLE else b'clientpriority'
372 )
373 return [ 371 return [
374 e for e in compengines if getattr(e.wireprotosupport(), attr) > 0 372 e for e in compengines if getattr(e.wireprotosupport(), attr) > 0
375 ] 373 ]
376 374
377 # If compression engines are listed in the config, assume there is a good 375 # If compression engines are listed in the config, assume there is a good