Mercurial > hg
comparison tests/test-convert-svn-encoding.t @ 45023:e54c3cafda15 stable
convert: convert URLs to UTF-8 for Subversion
Preamble: for comprehension, note that the `path` of geturl() would better be
called `path_or_url` (the argument of the call of getsvn() is called `url`).
For HTTP(S) URLs, the changes don’t make a difference, as they are restricted to
ASCII.
For file URLs, the reasoning is the same as for paths: we have to roundtrip with
what Subversion is doing.
When the locale encoding is ISO-8859-15, trying to convert a SVN repo
`file:///tmp/a€` failed before like this:
file:///tmp/a%A4 does not look like a Subversion repository to libsvn version 1.14.0
Decoding the path using the locale encoding can fail. In this case, we have to
bail out, as Subversion won’t be able to do anything useful with the path.
author | Manuel Jacob <me@manueljacob.de> |
---|---|
date | Tue, 30 Jun 2020 05:30:47 +0200 |
parents | e3b19004087a |
children | 6597e2a73a28 |
comparison
equal
deleted
inserted
replaced
45022:e3b19004087a | 45023:e54c3cafda15 |
---|---|
180 \xff does not look like a GNU Arch repository (glob) (esc) | 180 \xff does not look like a GNU Arch repository (glob) (esc) |
181 \xff does not look like a Bazaar repository (glob) (esc) | 181 \xff does not look like a Bazaar repository (glob) (esc) |
182 cannot find required "p4" tool | 182 cannot find required "p4" tool |
183 abort: \xff: missing or unsupported repository (glob) (esc) | 183 abort: \xff: missing or unsupported repository (glob) (esc) |
184 [255] | 184 [255] |
185 $ hg convert file://$TESTTMP/$XFF test | |
186 initializing destination test repository | |
187 Subversion requires that file URLs can be converted to Unicode using the current locale encoding (ascii) | |
188 file:/*/$TESTTMP/\xff does not look like a CVS checkout (glob) (esc) | |
189 $TESTTMP/file:$TESTTMP/\xff does not look like a Git repository (esc) | |
190 file:/*/$TESTTMP/\xff does not look like a Subversion repository (glob) (esc) | |
191 file:/*/$TESTTMP/\xff is not a local Mercurial repository (glob) (esc) | |
192 file:/*/$TESTTMP/\xff does not look like a darcs repository (glob) (esc) | |
193 file:/*/$TESTTMP/\xff does not look like a monotone repository (glob) (esc) | |
194 file:/*/$TESTTMP/\xff does not look like a GNU Arch repository (glob) (esc) | |
195 file:/*/$TESTTMP/\xff does not look like a Bazaar repository (glob) (esc) | |
196 file:/*/$TESTTMP/\xff does not look like a P4 repository (glob) (esc) | |
197 abort: file:/*/$TESTTMP/\xff: missing or unsupported repository (glob) (esc) | |
198 [255] | |
185 | 199 |
186 #if py3 | 200 #if py3 |
187 For now, on Python 3, we abort when encountering non-UTF-8 percent-encoded | 201 For now, on Python 3, we abort when encountering non-UTF-8 percent-encoded |
188 bytes in a filename. | 202 bytes in a filename. |
189 | 203 |