[PATCH 3 of 6] patch: migrate to util.iterfile

Yuya Nishihara yuya at tcha.org
Tue Nov 15 07:14:10 EST 2016


On Mon, 14 Nov 2016 23:35:55 +0000, Jun Wu wrote:
> # HG changeset patch
> # User Jun Wu <quark at fb.com>
> # Date 1479165246 0
> #      Mon Nov 14 23:14:06 2016 +0000
> # Node ID d1637df5ffd91e95da25213f06f346adb3269ace
> # Parent  8097b8c66952003addd5b683a14265c1d3cc201f
> # Available At https://bitbucket.org/quark-zju/hg-draft
> #              hg pull https://bitbucket.org/quark-zju/hg-draft -r d1637df5ffd9
> patch: migrate to util.iterfile

Not all read()s are interruptible by signals. I don't remember the detail, but
signal(7) of Linux says "read(2) ... calls on "slow" devices. ... Note that a
(local) disk is not a slow device according to this definition; I/O operations
on disk devices are not interrupted by signals."

Since readline() doesn't have cache in CPython layer, it would be slightly
slower than fp.__iter__().


More information about the Mercurial-devel mailing list