changeset 842:794f3e41ec1e stable

The handler seems to close the target in subversion-1.7.x. This patch works around it. It has also successfully been tested against subversion-1.6.17.
author Nico R. <n-roeser@gmx.net>
date Mon, 31 Oct 2011 00:47:52 +0100
parents 88f3cda47def
children df2c85478063
files hgsubversion/editor.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/editor.py
+++ b/hgsubversion/editor.py
@@ -342,10 +342,13 @@ class HgEditor(svnwrap.Editor):
             try:
                 if not self.meta.is_path_valid(self.current.file):
                     return
+                # Already get and store the value here, because calling
+                # handler(window) seems to close the target in Subversion 1.7.
+                val = target.getvalue()
                 handler(window)
                 # window being None means commit this file
                 if not window:
-                    self.current.files[self.current.file] = target.getvalue()
+                    self.current.files[self.current.file] = val
             except svnwrap.SubversionException, e: #pragma: no cover
                 if e.args[1] == svnwrap.ERR_INCOMPLETE_DATA:
                     self.current.missing.add(self.current.file)