Mercurial > hg
comparison mercurial/exchange.py @ 45062:72feaeb510b3
clonebundles: optional memory-requirement attribution
The new REQUIREDRAM option allows a client to skip bundles it isn't
expected to handle well, e.g. without swapping. This allows a fallback
path to be provided e.g. using zstd level 10 instead of 22.
Differential Revision: https://phab.mercurial-scm.org/D8645
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Mon, 22 Jun 2020 00:00:07 +0200 |
parents | bd7b2c8d06cc |
children | b1e51ef4e536 |
comparison
equal
deleted
inserted
replaced
45061:02b17231f6c3 | 45062:72feaeb510b3 |
---|---|
3023 repo.ui.debug( | 3023 repo.ui.debug( |
3024 b'filtering %s because SNI not supported\n' % entry[b'URL'] | 3024 b'filtering %s because SNI not supported\n' % entry[b'URL'] |
3025 ) | 3025 ) |
3026 continue | 3026 continue |
3027 | 3027 |
3028 if b'REQUIREDRAM' in entry: | |
3029 try: | |
3030 requiredram = util.sizetoint(entry[b'REQUIREDRAM']) | |
3031 except error.ParseError: | |
3032 repo.ui.debug( | |
3033 b'filtering %s due to a bad REQUIREDRAM attribute\n' | |
3034 % entry[b'URL'] | |
3035 ) | |
3036 continue | |
3037 actualram = repo.ui.estimatememory() | |
3038 if actualram is not None and actualram * 0.66 < requiredram: | |
3039 repo.ui.debug( | |
3040 b'filtering %s as it needs more than 2/3 of system memory\n' | |
3041 % entry[b'URL'] | |
3042 ) | |
3043 continue | |
3044 | |
3028 newentries.append(entry) | 3045 newentries.append(entry) |
3029 | 3046 |
3030 return newentries | 3047 return newentries |
3031 | 3048 |
3032 | 3049 |