# HG changeset patch # User Patrick Mezard # Date 1228270393 21600 # Node ID 04c92c2c4501635610e1ce2fc663f3c3ae7b3c17 # Parent 5438cc2d7ed7919255866ea72ecfedcfeef8eade SubversionRepo: work around ra.get_files() not releasing input buffer diff --git a/svnwrap/svn_swig_wrapper.py b/svnwrap/svn_swig_wrapper.py --- a/svnwrap/svn_swig_wrapper.py +++ b/svnwrap/svn_swig_wrapper.py @@ -437,9 +437,11 @@ class SubversionRepo(object): IOError. """ mode = '' - out = cStringIO.StringIO() try: + out = cStringIO.StringIO() info = ra.get_file(self.ra, path, revision, out) + data = out.getvalue() + out.close() if isinstance(info, list): info = info[-1] mode = ("svn:executable" in info) and 'x' or '' @@ -450,7 +452,6 @@ class SubversionRepo(object): if e.apr_err in notfound: # File not found raise IOError() raise - data = out.getvalue() if mode == 'l': linkprefix = "link " if data.startswith(linkprefix):