changeset 92:e1dc7aa60cd4

Check whether the path is a path with Windows drive letters also
author Franz Glasner <hg@dom66.de>
date Tue, 27 Feb 2018 18:41:24 +0100
parents 36369940d31b
children fa84debfb50e
files extensions/kwarchive.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/extensions/kwarchive.py	Tue Feb 27 18:28:51 2018 +0100
+++ b/extensions/kwarchive.py	Tue Feb 27 18:41:24 2018 +0100
@@ -368,8 +368,11 @@
                 raise error.Abort(_('repository %s not found') % hgpath)
     else:
         path_uri = repo.root
-    # Make an URL from a Windows UNC path
     if path_uri.startswith(b"\\\\"):
+        # Make an URL from a Windows UNC path
+        path_uri = b"file:///" + path_uri.replace(b'\\', b'/')
+    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'/')
     keywords = {
         "HGpath": path_uri,