comparison mercurial/store.py @ 48941:fd5b8e696b75

py3: stop using util.iterfile() The Python 3 implementation is a no-op. So this is equivalent. We still keep util.iterfile() around for backwards API compatibility to help the Python 3 migration. It can be deleted in a future release. Differential Revision: https://phab.mercurial-scm.org/D12347
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 21 Feb 2022 12:42:48 -0700
parents f254fc73d956
children 642e31cb55f0
comparison
equal deleted inserted replaced
48940:2974cdda819b 48941:fd5b8e696b75
659 659
660 def _checkentries(self, fp, warn): 660 def _checkentries(self, fp, warn):
661 """make sure there is no empty string in entries""" 661 """make sure there is no empty string in entries"""
662 if b'' in self.entries: 662 if b'' in self.entries:
663 fp.seek(0) 663 fp.seek(0)
664 for n, line in enumerate(util.iterfile(fp)): 664 for n, line in enumerate(fp):
665 if not line.rstrip(b'\n'): 665 if not line.rstrip(b'\n'):
666 t = _(b'invalid entry in fncache, line %d') % (n + 1) 666 t = _(b'invalid entry in fncache, line %d') % (n + 1)
667 if warn: 667 if warn:
668 warn(t + b'\n') 668 warn(t + b'\n')
669 else: 669 else: