changeset 45026:ddf66c218104 stable

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.
author Manuel Jacob <me@manueljacob.de>
date Tue, 30 Jun 2020 16:39:45 +0200
parents 6597e2a73a28
children 0ea9c86fac89
files hgext/convert/subversion.py
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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))