Mercurial > hgrepos > DevTools > mercurial-extensions
changeset 96:6ecb3909f95e
Make absolute POSIX paths always start with "file://" -- a path should always have the form of an URI
| author | Franz Glasner <hg@dom66.de> |
|---|---|
| date | Mon, 05 Mar 2018 09:22:06 +0100 |
| parents | 3c7ec88a04a5 |
| children | 507e301eede4 |
| files | extensions/kwarchive.py |
| diffstat | 1 files changed, 3 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/extensions/kwarchive.py Wed Feb 28 11:11:24 2018 +0100 +++ b/extensions/kwarchive.py Mon Mar 05 09:22:06 2018 +0100 @@ -394,6 +394,9 @@ elif len(path_uri) >= 2 and (b'A' <= path_uri[0].upper() <= b'Z') and path_uri[1] == b':': # make an URL from a Windows path with drive letter path_uri = b"file:///" + path_uri.replace(b'\\', b'/') + elif path_uri.startswith(b'/'): + # an absolute POSIX path + path_uri = b"file://" + path_uri keywords = { "HGpath": path_uri, "HGrevision": ctx.hex(),
