convert: migrate to util.iterfile
authorJun Wu <quark@fb.com>
Mon, 14 Nov 2016 23:17:15 +0000
changeset 30400 d1a0a64f6e16
parent 30399 7f3593c29473
child 30401 869d660b8669
convert: migrate to util.iterfile
hgext/convert/common.py
hgext/convert/convcmd.py
--- a/hgext/convert/common.py	Mon Nov 14 23:16:05 2016 +0000
+++ b/hgext/convert/common.py	Mon Nov 14 23:17:15 2016 +0000
@@ -454,7 +454,7 @@
             if err.errno != errno.ENOENT:
                 raise
             return
-        for i, line in enumerate(fp):
+        for i, line in enumerate(util.iterfile(fp)):
             line = line.splitlines()[0].rstrip()
             if not line:
                 # Ignore blank lines
--- a/hgext/convert/convcmd.py	Mon Nov 14 23:16:05 2016 +0000
+++ b/hgext/convert/convcmd.py	Mon Nov 14 23:17:15 2016 +0000
@@ -201,7 +201,7 @@
         m = {}
         try:
             fp = open(path, 'r')
-            for i, line in enumerate(fp):
+            for i, line in enumerate(util.iterfile(fp)):
                 line = line.splitlines()[0].rstrip()
                 if not line:
                     # Ignore blank lines