##// END OF EJS Templates
py3: stop using util.iterfile()...
Gregory Szorc -
r49796:fd5b8e69 default
parent child Browse files
Show More
@@ -552,7 +552,7 b' class mapfile(dict):'
552 if err.errno != errno.ENOENT:
552 if err.errno != errno.ENOENT:
553 raise
553 raise
554 return
554 return
555 for i, line in enumerate(util.iterfile(fp)):
555 for i, line in enumerate(fp):
556 line = line.splitlines()[0].rstrip()
556 line = line.splitlines()[0].rstrip()
557 if not line:
557 if not line:
558 # Ignore blank lines
558 # Ignore blank lines
@@ -242,7 +242,7 b' class converter(object):'
242 m = {}
242 m = {}
243 try:
243 try:
244 fp = open(path, b'rb')
244 fp = open(path, b'rb')
245 for i, line in enumerate(util.iterfile(fp)):
245 for i, line in enumerate(fp):
246 line = line.splitlines()[0].rstrip()
246 line = line.splitlines()[0].rstrip()
247 if not line:
247 if not line:
248 # Ignore blank lines
248 # Ignore blank lines
@@ -1611,7 +1611,7 b' def readpatternfile(filepath, warn, sour'
1611 patterns = []
1611 patterns = []
1612
1612
1613 fp = open(filepath, b'rb')
1613 fp = open(filepath, b'rb')
1614 for lineno, line in enumerate(util.iterfile(fp), start=1):
1614 for lineno, line in enumerate(fp, start=1):
1615 if b"#" in line:
1615 if b"#" in line:
1616 global _commentre
1616 global _commentre
1617 if not _commentre:
1617 if not _commentre:
@@ -1259,7 +1259,7 b' the hunk is left unchanged.'
1259 # Remove comment lines
1259 # Remove comment lines
1260 patchfp = open(patchfn, 'rb')
1260 patchfp = open(patchfn, 'rb')
1261 ncpatchfp = stringio()
1261 ncpatchfp = stringio()
1262 for line in util.iterfile(patchfp):
1262 for line in patchfp:
1263 line = util.fromnativeeol(line)
1263 line = util.fromnativeeol(line)
1264 if not line.startswith(b'#'):
1264 if not line.startswith(b'#'):
1265 ncpatchfp.write(line)
1265 ncpatchfp.write(line)
@@ -2343,7 +2343,7 b' def _externalpatch(ui, repo, patcher, pa'
2343 ui.debug(b'Using external patch tool: %s\n' % cmd)
2343 ui.debug(b'Using external patch tool: %s\n' % cmd)
2344 fp = procutil.popen(cmd, b'rb')
2344 fp = procutil.popen(cmd, b'rb')
2345 try:
2345 try:
2346 for line in util.iterfile(fp):
2346 for line in fp:
2347 line = line.rstrip()
2347 line = line.rstrip()
2348 ui.note(line + b'\n')
2348 ui.note(line + b'\n')
2349 if line.startswith(b'patching file '):
2349 if line.startswith(b'patching file '):
@@ -661,7 +661,7 b' class fncache(object):'
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:
General Comments 0
You need to be logged in to leave comments. Login now