changeset 30410:d1a0a64f6e16

convert: migrate to util.iterfile
author Jun Wu <quark@fb.com>
date Mon, 14 Nov 2016 23:17:15 +0000
parents 7f3593c29473
children 869d660b8669
files hgext/convert/common.py hgext/convert/convcmd.py
diffstat 2 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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