Fix for Utilities.relativePath() not considering the path to make relative to ending in '/' or '\'.

Wed, 21 Dec 2016 13:25:01 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Wed, 21 Dec 2016 13:25:01 +0100
changeset 5385
b1ed8297b183
parent 5384
22c15d7e2cad
child 5386
721d47a4085a
child 5387
87800d562ca5

Fix for Utilities.relativePath() not considering the path to make relative to ending in '/' or '\'.

Utilities/__init__.py file | annotate | diff | comparison | revisions
--- a/Utilities/__init__.py	Mon Dec 19 13:30:52 2016 +0100
+++ b/Utilities/__init__.py	Wed Dec 21 13:25:01 2016 +0100
@@ -861,7 +861,10 @@
         if path == start:
             return ""
         else:
-            return path[len(start) + 1:]
+            if start.endswith(("/", "\\")):
+                return path[len(start):]
+            else:
+                return path[len(start) + 1:]
     else:
         return path
 

eric ide

mercurial