##// 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:

r12156:4c94b6d0 default
r31400:fb1f7033 default
Show More
test-revert-unknown.t
29 lines | 319 B | text/troff | Tads3Lexer
/ tests / test-revert-unknown.t
Nicolas Dumazet
tests: unify test-revert-unknown
r12111 $ hg init
$ touch unknown
$ touch a
$ hg add a
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg ci -m "1"
Nicolas Dumazet
tests: unify test-revert-unknown
r12111
$ touch b
$ hg add b
Martin Geisler
tests: remove unneeded -d flags...
r12156 $ hg ci -m "2"
Nicolas Dumazet
tests: unify test-revert-unknown
r12111
Should show unknown
$ hg status
? unknown
$ hg revert -r 0 --all
removing b
Should show unknown and b removed
$ hg status
R b
? unknown
Should show a and unknown
$ ls
a
unknown