comparison mercurial/store.py @ 47031:f38bf44e077f stable

black: make codebase compatible with black v21.4b2 and v20.8b1 I don't know what exact version of black made it care about these whitespace differences, but this is the version I got when I just installed it with `pip3 install black`. I'm intentionally not increasing the version of black required, as I don't want to force everyone to upgrade their version of black, and these fixes are backwards compatible with black v20.8b1. If there are more issues in the future and this becomes a maintenance burden I may do so in a future change. Tested with both versions of black (I got the older version via `pip3 install black==20.8b1`) Differential Revision: https://phab.mercurial-scm.org/D10539
author Kyle Lippincott <spectral@google.com>
date Fri, 30 Apr 2021 16:13:02 -0700
parents 0b569c75d180
children 8f6165c90163
comparison
equal deleted inserted replaced
47030:bd2ed1032b4e 47031:f38bf44e077f
627 ) 627 )
628 self._checkentries(fp, warn) 628 self._checkentries(fp, warn)
629 fp.close() 629 fp.close()
630 630
631 def _checkentries(self, fp, warn): 631 def _checkentries(self, fp, warn):
632 """ make sure there is no empty string in entries """ 632 """make sure there is no empty string in entries"""
633 if b'' in self.entries: 633 if b'' in self.entries:
634 fp.seek(0) 634 fp.seek(0)
635 for n, line in enumerate(util.iterfile(fp)): 635 for n, line in enumerate(util.iterfile(fp)):
636 if not line.rstrip(b'\n'): 636 if not line.rstrip(b'\n'):
637 t = _(b'invalid entry in fncache, line %d') % (n + 1) 637 t = _(b'invalid entry in fncache, line %d') % (n + 1)