[Svnmerge] Encoding problem in svnmerge commit message file

Romulo A. Ceccon romuloceccon at yahoo.com.br
Wed Dec 5 13:19:34 PST 2007


--- Thomas Heller <theller at ctypes.org> wrote:

> While I support the use of ctypes sa much as possible ;-), would
> not this approach be better?  It might even work on linuxes...

Oh, sure! (I'm not fluent on Python). Only I'd rename the method. :)

Romulo



Index: svnmerge.py
===================================================================
--- svnmerge.py	(revision 28283)
+++ svnmerge.py	(working copy)
@@ -208,6 +208,10 @@
     assert lines[-1] == "\n"
     return prefix + lines[:-1].replace("\n", "\n"+prefix) + "\n"
 
+def recode_stdout_to_file(s):
+    u = s.decode(sys.stdout.encoding)
+    return u.encode(sys.getfilesystemencoding())
+
 class LaunchError(Exception):
     """Signal a failure in execution of an external command. Parameters are
the
     exit code of the process, the original command line, and the output of the
@@ -933,7 +937,7 @@
     """Return the log message for a specific integer revision
     number."""
     out = launchsvn("log --incremental -r%d %s" % (revnum, url))
-    return "".join(out[1:])
+    return recode_stdout_to_file("".join(out[1:]))
 
 def construct_merged_log_message(url, revnums):
     """Return a commit log message containing all the commit messages



      ____________________________________________________________________________________
Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ 




More information about the Svnmerge mailing list