Patchwork [4,of,6] store: migrate to util.iterfile

login
register
mail settings
Submitter Jun Wu
Date Nov. 14, 2016, 11:35 p.m.
Message ID <9ea33341bb12e2f6a862.1479166556@x1c>
Download mbox | patch
Permalink /patch/17572/
State Accepted
Headers show

Comments

Jun Wu - Nov. 14, 2016, 11:35 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1479165301 0
#      Mon Nov 14 23:15:01 2016 +0000
# Node ID 9ea33341bb12e2f6a862c8d3ca1eb6b8036d3602
# Parent  d1637df5ffd91e95da25213f06f346adb3269ace
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 9ea33341bb12
store: migrate to util.iterfile

Patch

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -437,5 +437,5 @@  class fncache(object):
         if '' in self.entries:
             fp.seek(0)
-            for n, line in enumerate(fp):
+            for n, line in enumerate(util.iterfile(fp)):
                 if not line.rstrip('\n'):
                     t = _('invalid entry in fncache, line %d') % (n + 1)