[Svnmerge] Patch for international support of SVN

Giovanni Bajo rasky at develer.com
Tue Jan 30 11:36:40 PST 2007


On 1/30/2007 4:23 PM, book at cpan.org wrote:

> I just tried svnmerge for the first time (yeah, they removed the .py on
> Debian), but it wasn't very successful:
> 
>     $ svnmerge init -v -v
>     svn propget --strict "svnmerge-integrated" "."
>     svnmerge: calculate head path for the branch
>     svn info "."
>     Traceback (most recent call last):
>       File "/usr/bin/svnmerge", line 1946, in ?
>         main(sys.argv[1:])
>       File "/usr/bin/svnmerge", line 1886, in main
>         cf_head, cf_rev =3D get_copyfrom(branch_dir)
>       File "/usr/bin/svnmerge", line 764, in get_copyfrom
>         repos_path =3D target_to_repos_relative_path(dir)
>       File "/usr/bin/svnmerge", line 754, in target_to_repos_relative_path
>         root =3D get_repo_root(target)
>       File "/usr/bin/svnmerge", line 726, in get_repo_root
>         url =3D target_to_url(dir)
>       File "/usr/bin/svnmerge", line 714, in target_to_url
>         return info["URL"]
>     KeyError: 'URL'
> 
> Apparently, svnmerge hates me because I'm French:
> 
>     $ printenv LC_ALL
>     fr_FR.UTF-8
>     $ LC_ALL=C svnmerge init
>     property 'svnmerge-integrated' set on '.'
> 
> Here's a quick and dirty patch that works for me:
> 
> Index: svnmerge.py
> ===================================================================
> --- svnmerge.py	(revision 23287)
> +++ svnmerge.py	(working copy)
> @@ -206,6 +206,7 @@
>      optionally split by lines (if split_lines is True). Raise a LaunchError
>      exception if the exit code of the process is non-zero (failure)."""
>      if os.name not in ['nt', 'os2']:
> +        cmd = "LC_ALL=C " + cmd
>          p = popen2.Popen4(cmd)
>          p.tochild.close()
>          if split_lines:
> 
> It was done against the HEAD of
> http://svn.collab.net/repos/svn/trunk/contrib/client-side

That's weird since svnmerge already contains this code:

# We expect non-localized output from SVN
os.environ["LC_MESSAGES"] = "C"

To the best of my understing SVN/APR uses LC_MESSAGES to decide how to 
localize messages. Any clue why that does not work for you?
-- 
Giovanni Bajo




More information about the Svnmerge mailing list