# HG changeset patch # User Sascha Nemecek # Date 2018-02-28 15:24:39 # Node ID d697e39f61a6c2321b7ccae3d093f57ad382d52d # Parent aa32940279364faf4b5f1088ea78512d3262e30d convert: avoid closing ui.fout in subversion code (issue5807) Don't close 'fp' (= 'ui.fout') stream to prevent 'ValueError: I/O operation on closed file' (Bug #5807). Regression of changeset 30261:6bed17ba00a1 (https://www.mercurial-scm.org/repo/hg/rev/6bed17ba00a1) diff --git a/hgext/convert/subversion.py b/hgext/convert/subversion.py --- a/hgext/convert/subversion.py +++ b/hgext/convert/subversion.py @@ -149,7 +149,7 @@ def get_log_child(fp, url, paths, start, pickle.dump(str(inst), fp, protocol) else: pickle.dump(None, fp, protocol) - fp.close() + fp.flush() # With large history, cleanup process goes crazy and suddenly # consumes *huge* amount of memory. The output file being closed, # there is no need for clean termination.