##// END OF EJS Templates
convert: work around svn.ra.get_files() not releasing input buffer
Patrick Mezard -
r7446:2d2e0be7 default
parent child Browse files
Show More
@@ -851,7 +851,6 b' class svn_source(converter_source):'
851 raise
851 raise
852
852
853 def _getfile(self, file, rev):
853 def _getfile(self, file, rev):
854 io = StringIO()
855 # TODO: ra.get_file transmits the whole file instead of diffs.
854 # TODO: ra.get_file transmits the whole file instead of diffs.
856 mode = ''
855 mode = ''
857 try:
856 try:
@@ -859,7 +858,12 b' class svn_source(converter_source):'
859 if self.module != new_module:
858 if self.module != new_module:
860 self.module = new_module
859 self.module = new_module
861 self.reparent(self.module)
860 self.reparent(self.module)
861 io = StringIO()
862 info = svn.ra.get_file(self.ra, file, revnum, io)
862 info = svn.ra.get_file(self.ra, file, revnum, io)
863 data = io.getvalue()
864 # ra.get_files() seems to keep a reference on the input buffer
865 # preventing collection. Release it explicitely.
866 io.close()
863 if isinstance(info, list):
867 if isinstance(info, list):
864 info = info[-1]
868 info = info[-1]
865 mode = ("svn:executable" in info) and 'x' or ''
869 mode = ("svn:executable" in info) and 'x' or ''
@@ -870,7 +874,6 b' class svn_source(converter_source):'
870 if e.apr_err in notfound: # File not found
874 if e.apr_err in notfound: # File not found
871 raise IOError()
875 raise IOError()
872 raise
876 raise
873 data = io.getvalue()
874 if mode == 'l':
877 if mode == 'l':
875 link_prefix = "link "
878 link_prefix = "link "
876 if data.startswith(link_prefix):
879 if data.startswith(link_prefix):
General Comments 0
You need to be logged in to leave comments. Login now