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

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

Comments

Jun Wu - Nov. 14, 2016, 11:35 p.m.
# HG changeset patch
# User Jun Wu <quark@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

Patch

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