Patchwork [5,of,7] extdata: just use iterator to read lines one by one

login
register
mail settings
Submitter Yuya Nishihara
Date Oct. 1, 2017, noon
Message ID <88bc2465f1c9dd7c9a7f.1506859216@mimosa>
Download mbox | patch
Permalink /patch/24335/
State Accepted
Headers show

Comments

Yuya Nishihara - Oct. 1, 2017, noon
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1506855507 -3600
#      Sun Oct 01 11:58:27 2017 +0100
# Node ID 88bc2465f1c9dd7c9a7f76eec68530b1a62f3794
# Parent  18b0ae593fb5f391878567cd0f676c623847614e
extdata: just use iterator to read lines one by one

Patch

diff --git a/mercurial/scmutil.py b/mercurial/scmutil.py
--- a/mercurial/scmutil.py
+++ b/mercurial/scmutil.py
@@ -1052,7 +1052,7 @@  def extdatasource(repo, source):
         src = url.open(repo.ui, spec)
 
     try:
-        for l in src.readlines():
+        for l in src:
             if " " in l:
                 k, v = l.strip().split(" ", 1)
             else: