Patchwork [2,of,6] worker: migrate to util.iterfile

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

Comments

Jun Wu - Nov. 14, 2016, 11:35 p.m.
# HG changeset patch
# User Jun Wu <quark@fb.com>
# Date 1479165131 0
#      Mon Nov 14 23:12:11 2016 +0000
# Node ID 8097b8c66952003addd5b683a14265c1d3cc201f
# Parent  7e3bb7754d338399dee3ee41770b7d6624b81fc1
# Available At https://bitbucket.org/quark-zju/hg-draft
#              hg pull https://bitbucket.org/quark-zju/hg-draft -r 8097b8c66952
worker: migrate to util.iterfile

Patch

diff --git a/mercurial/worker.py b/mercurial/worker.py
--- a/mercurial/worker.py
+++ b/mercurial/worker.py
@@ -15,5 +15,8 @@  import threading
 
 from .i18n import _
-from . import error
+from . import (
+    error,
+    util,
+)
 
 def countcpus():
@@ -129,5 +132,5 @@  def _posixworker(ui, func, staticargs, a
             sys.exit(status)
     try:
-        for line in fp:
+        for line in util.iterfile(fp):
             l = line.split(' ', 1)
             yield int(l[0]), l[1][:-1]