convert: add docstring on convert.subversion.geturl() stable
authorManuel Jacob <me@manueljacob.de>
Tue, 30 Jun 2020 16:39:45 +0200
branchstable
changeset 45026 ddf66c218104
parent 45024 6597e2a73a28
child 45027 0ea9c86fac89
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.
hgext/convert/subversion.py
--- 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))