> >>> One question: is using LC_MESSAGES=C enough to fix the regression? In
> >>> that case, I would assume that LC_MESSAGES would only affect SVN's own
> >>> strings and not log messages. It would be a win-win.
> >> Good idea, but svn doesn't seem to respect LC_MESSAGES for the output
> >> of svn info:
> >>
> >> # export LC_ALL=de_DE
> >> # svn info | head -1
> >> Pfad: .
> >>
> >> # LC_MESSAGES=C svn info | head -1
> >> Pfad: .
> >>
> >> # LC_ALL=C svn info | head -1
> >> Path: .
> >
> > I see. I guess this changed in later SVN versions (given that
> > svnmerge.sh used to use LC_MESSAGES), but never mind.
>
> LC_MESSAGES is respected by svn, as long as LC_ALL is *not* set. This
> is apparently correct POSIX behavior:
>
> http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap08.html#tag_08_02
>
> Also, Hernan has shown that svn *does* override the Windows regional
> settings with the value of LC_MESSAGES. So the Windows regional
> settings are roughly equivalent to the UNIX LANG variable.
>
> Therefore, should the attached patch solve the issue?
>
> I don't know if this will regress svnmerge.py on Romulo's problem. The
> testCommitMessageEncoding test case passes on my machine, but the test
> case is heavily dependent on the machine environment in which it is
> run. It would be helpful if Romulo could test this but I've been
> getting bounces on his email address.

I've just tested your patch against trunk and as far as I can tell everything is
working now under my environment: Spanish Windows XP SP2.
The svnmerge.py test suite pass and Romulo's script shows the expected output.

Follows the test suite output and attached the output of Romulo's script.

Regards,
-Hernan.

---------------------------------------------------------

D:\proyectos\svnmerge>svn status
M      svnmerge.py

D:\proyectos\svnmerge>svn diff
Index: svnmerge.py
===================================================================
--- svnmerge.py (revisión: 29812)
+++ svnmerge.py (copia de trabajo)
@@ -94,6 +94,12 @@
 # the locale to match that encoding
 locale.setlocale(locale.LC_ALL, '')

+# We want the svn output (such as svn info) to be non-localized
+# Using LC_MESSAGES should not affect localized output of svn log, for example
+if os.environ.has_key("LC_ALL"):
+    del os.environ["LC_ALL"]
+os.environ["LC_MESSAGES"] = "C"
+
 ###############################################################################
 # Support for older Python versions
 ###############################################################################

D:\proyectos\svnmerge>svnmerge_test.py
..................................................
----------------------------------------------------------------------
Ran 50 tests in 159.140s

OK

D:\proyectos\svnmerge>
D:\proyectos>svnmergebugori.cmd
Revisión obtenida: 0
A         trunk
A         branches
A         tags
Añadiendo      branches
Añadiendo      tags
Añadiendo      trunk

Commit de la revisión 1.
Revisión obtenida: 1
A         test.txt
Añadiendo      test.txt
Transmitiendo contenido de archivos .
Commit de la revisión 2.

Commit de la revisión 3.
A    branch1\test.txt
Revisión obtenida: 3
property 'svnmerge-integrated' set on '.'

Enviando       .

Commit de la revisión 4.

**************************************************************************
Modifying trunk version and commiting with message "correções". Since SVN
reads it from the command line it assumes it correctly as being encoded
with IBM850.
**************************************************************************
Enviando       test.txt
Transmitiendo contenido de archivos .
Commit de la revisión 5.

**************************************************************************
Resulting log message from SVN
**************************************************************************
------------------------------------------------------------------------
r5 | Hernan | 2008-03-09 16:34:45 +0100 (dom, 09 mar 2008) | 1 line

correções
------------------------------------------------------------------------

**************************************************************************
Merging changes from trunk to branch via svnmerge
**************************************************************************
property 'svnmerge-integrated' deleted from '.'.

property 'svnmerge-blocked' deleted from '.'.

U    test.txt

property 'svnmerge-integrated' set on '.'

property 'svnmerge-blocked' deleted from '.'.


**************************************************************************
Message generated by svnmerge. An affected version will produce a readable
message ("correções") for revision 5 because the prompt interprets the
file as being encoded with IBM850.
**************************************************************************
Merged revisions 5 via svnmerge from
file:///U:/repo/trunk

........
  r5 | Hernan | 2008-03-09 16:34:45 +0100 (dom, 09 mar 2008) | 1 line

  correþ§es
........

**************************************************************************
Commiting with the command "svn commit -F svnmerge-commit-message.txt".
This will produce a misencoded log message because SVN thinks the
file uses CP1252, while svnmerge used IBM850. That may be workarounded
appending the option "--encoding IBM850" to the commit command.
**************************************************************************
Enviando       .
Enviando       test.txt
Transmitiendo contenido de archivos .
Commit de la revisión 6.

**************************************************************************
Below is the resulting log message. The correct message from revision 5
should read "correções". The INCORRECT message reads "corre_äes".
**************************************************************************
------------------------------------------------------------------------
r6 | Hernan | 2008-03-09 16:34:48 +0100 (dom, 09 mar 2008) | 9 lines

Merged revisions 5 via svnmerge from
file:///U:/repo/trunk

........
  r5 | Hernan | 2008-03-09 16:34:45 +0100 (dom, 09 mar 2008) | 1 line

  correções
........

------------------------------------------------------------------------

D:\proyectos>
_______________________________________________
Svnmerge mailing list
[email protected]
http://www.orcaware.com/mailman/listinfo/svnmerge

Reply via email to