convert: add docstring on convert.subversion.geturl()
The function is unusual for a bytes-handling function in Mercurial because it
can’t handle arbitrary bytes. Therefore we should document this fact.
Pointed out by Yuya Nishihara while reviewing
e3b19004087a.
--- a/hgext/convert/subversion.py Tue Jun 30 01:32:17 2020 +0200
+++ b/hgext/convert/subversion.py Tue Jun 30 16:39:45 2020 +0200
@@ -140,6 +140,11 @@
def geturl(path):
+ """Convert path or URL to a SVN URL, encoded in UTF-8.
+
+ This can raise UnicodeDecodeError if the path or URL can't be converted to
+ unicode using `fsencoding`.
+ """
try:
return svn.client.url_from_path(
svn.core.svn_path_canonicalize(fs2svn(path))