diff extensions/kwarchive.py @ 159:d313b33c9c06

Implement the "last" path-filter for the local repo "." also
author Franz Glasner <hg@dom66.de>
date Mon, 27 Aug 2018 23:32:28 +0200
parents 07e323b8d27d
children a959c387bf24
line wrap: on
line diff
--- a/extensions/kwarchive.py	Mon Aug 27 11:14:55 2018 +0200
+++ b/extensions/kwarchive.py	Mon Aug 27 23:32:28 2018 +0200
@@ -544,8 +544,11 @@
         except LookupError:
             raise error.Abort(_('repository %s not found') % hgpath)
     else:
-        assert (hgpath is None) or (hgpath == ".")
         path_uri = repo.root
+        if path_filter == "last":
+            m = max(path_uri.rfind(b"/"), path_uri.rfind(b"\\"))
+            if m >= 0:
+                path_uri = b".../" + path_uri[m+1:]
     if path_uri.startswith(b"\\\\"):
         # Make an URL from a Windows UNC path
         path_uri = b"file:///" + path_uri.replace(b'\\', b'/')