comparison hgext/remotefilelog/datapack.py @ 51690:493034cc3265

black: format the codebase with 23.3.0 The CI has moved to 23.3.0, which is the last version that supports 3.7 at runtime, so we should honor this change. # skip-blame mass-reformating only
author Raphaël Gomès <rgomes@octobus.net>
date Thu, 18 Jul 2024 12:36:12 +0200
parents d44e3c45f0e4
children 7f0cb9ee0534
comparison
equal deleted inserted replaced
51689:39e2b2d062c1 51690:493034cc3265
412 def _compress(self, data): 412 def _compress(self, data):
413 return zlib.compress(data) 413 return zlib.compress(data)
414 414
415 def add(self, name, node, deltabasenode, delta, metadata=None): 415 def add(self, name, node, deltabasenode, delta, metadata=None):
416 # metadata is a dict, ex. {METAKEYFLAG: flag} 416 # metadata is a dict, ex. {METAKEYFLAG: flag}
417 if len(name) > 2 ** 16: 417 if len(name) > 2**16:
418 raise RuntimeError(_(b"name too long %s") % name) 418 raise RuntimeError(_(b"name too long %s") % name)
419 if len(node) != 20: 419 if len(node) != 20:
420 raise RuntimeError(_(b"node should be 20 bytes %s") % node) 420 raise RuntimeError(_(b"node should be 20 bytes %s") % node)
421 421
422 if node in self.entries: 422 if node in self.entries: