##// END OF EJS Templates
pycompat: custom implementation of urllib.parse.quote()...
pycompat: custom implementation of urllib.parse.quote() urllib.parse.quote() accepts either str or bytes and returns str. There exists a urllib.parse.quote_from_bytes() which only accepts bytes. We should probably use that to retain strong typing and avoid surprises. In addition, since nearly all strings in Mercurial are bytes, we probably don't want quote() returning unicode. So, this patch implements a custom quote() that only accepts bytes and returns bytes. The quoted URL should only contain URL safe characters which is a strict subset of ASCII. So `.encode('ascii', 'strict')` should be safe.

File last commit:

r26420:2fc86d92 default
r31400:fb1f7033 default
Show More
test-issue1438.t
23 lines | 367 B | text/troff | Tads3Lexer
Matt Mackall
tests: replace exit 80 with #require
r22046 #require symlink
Adrian Buehlmann
tests: unify test-issue1438 and test-issue2137
r12204
Matt Mackall
urls: bulk-change BTS urls to new location
r26420 https://bz.mercurial-scm.org/1438
Adrian Buehlmann
tests: unify test-issue1438 and test-issue2137
r12204
$ hg init
$ ln -s foo link
$ hg add link
$ hg ci -mbad link
$ hg rm link
$ hg ci -mok
$ hg diff -g -r 0:1 > bad.patch
$ hg up 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ hg import --no-commit bad.patch
applying bad.patch
$ hg status
R link
? bad.patch