[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn blame and filenames with non-ascii chars

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-12-13 18:27:58 CET

John Szakmeister <john@szakmeister.net> writes:

> Index: subversion/libsvn_client/blame.c
> ===================================================================
> --- subversion/libsvn_client/blame.c (revision 7978)
> +++ subversion/libsvn_client/blame.c (working copy)
> @@ -378,7 +378,9 @@
>
> SVN_ERR (ra_lib->get_repos_root (session, &reposURL, pool));
>
> - lmb.path = url + strlen (reposURL);
> + /* Convert path from URI to UTF-8 before placing it in the baton */
> + lmb.path = svn_path_uri_decode (url + strlen (reposURL), pool);

Hmmm...

My first instinct was "the comment is redundant" since it duplicates
the documented behaviour of the function. Then I realised that the
documentation doesn't mention UTF-8, so I started thinking about the
URL. It's already UTF-8 isn't it? Whether the decoded URL is UTF-8
depends on what characters are URI encoded in the URL, where do we
guarantee that the URL contains URI encoded UTF-8?

Next I tried a few things

$ svnadmin create repo
$ svn import Makefile http://localhost:8888/obj/repo/%c3%a9 -m ""
$ LANG=en_GB svn ls http://localhost:8888/obj/repo
é
$ svn blame http://localhost:8888/obj/repo/%c3%a9
../svn/subversion/libsvn_client/blame.c:308: (apr_err=20014)
svn: Missing changed-path information for revision 1 of '%a9'
$ LANG=en_GB svn ls file://`pwd`/repo/%c3%a9
../svn/subversion/libsvn_client/ls.c:144: (apr_err=160013)
svn: URL non-existent in that revision.

Rather alarmingly, I can get non-UTF-8 names into the repository

$ svn import Makefile http://localhost:8888/obj/repo/%e9 -m ""
$ svnadmin dump -q repo | grep Node-path
Node-path: é

which cause ra_dav to produce an error

LANG=en_GB svn ls http://localhost:8888/obj/repo/
../svn/subversion/libsvn_ra_dav/util.c:661: (apr_err=175002)
svn: PROPFIND request failed on '/obj/repo/!svn/bc/2'
../svn/subversion/libsvn_ra_dav/util.c:647: (apr_err=175002)
svn: The PROPFIND request returned invalid XML in the response: XML parse error at line 28: Bytes: 0xE9 0x22 0x3C 0x2F
.. (/obj/repo/!svn/bc/2)

and ra_local to enter an infinte loop

LANG=en_GB svn ls file://`pwd`/repo

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Dec 13 18:29:04 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.