[PATCH 5 of 6] match: migrate to util.iterfile

Jun Wu quark at fb.com
Mon Nov 14 18:35:57 EST 2016


# HG changeset patch
# User Jun Wu <quark at fb.com>
# Date 1479165365 0
#      Mon Nov 14 23:16:05 2016 +0000
# Node ID 23ebc9cb6d773d549b6822da154da3c0125b90c5
# Parent  9ea33341bb12e2f6a862c8d3ca1eb6b8036d3602
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 23ebc9cb6d77
match: migrate to util.iterfile

diff --git a/mercurial/match.py b/mercurial/match.py
--- a/mercurial/match.py
+++ b/mercurial/match.py
@@ -670,5 +670,5 @@ def readpatternfile(filepath, warn, sour
 
     fp = open(filepath)
-    for lineno, line in enumerate(fp, start=1):
+    for lineno, line in enumerate(util.iterfile(fp), start=1):
         if "#" in line:
             global _commentre


More information about the Mercurial-devel mailing list