mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 07:17:55 +03:00
hbisect: use tryreadlines to load state
This closes the file handle after reading, which stops PyPy from leaking open file handles and thus failing test-bisect3.t.
This commit is contained in:
parent
cf9489897c
commit
6d56e2235c
@ -11,7 +11,6 @@
|
||||
from __future__ import absolute_import
|
||||
|
||||
import collections
|
||||
import os
|
||||
|
||||
from .i18n import _
|
||||
from .node import (
|
||||
@ -143,8 +142,7 @@ def bisect(changelog, state):
|
||||
|
||||
def load_state(repo):
|
||||
state = {'current': [], 'good': [], 'bad': [], 'skip': []}
|
||||
if os.path.exists(repo.join("bisect.state")):
|
||||
for l in repo.vfs("bisect.state"):
|
||||
for l in repo.vfs.tryreadlines("bisect.state"):
|
||||
kind, node = l[:-1].split()
|
||||
node = repo.lookup(node)
|
||||
if kind not in state:
|
||||
|
Loading…
Reference in New Issue
Block a user