diff svnwrap/svn_swig_wrapper.py @ 122:04c92c2c4501

SubversionRepo: work around ra.get_files() not releasing input buffer
author Patrick Mezard <pmezard@gmail.com>
date Tue, 02 Dec 2008 20:13:13 -0600
parents 0d3a2a7cefa3
children ba801f44d240
line wrap: on
line diff
--- 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):