changeset 302:15d317805c58

Fix finding wiki roots on Windows.
author Ludovic Chabant <ludovic@chabant.com>
date Mon, 29 Sep 2014 13:52:08 -0700
parents 19a377f4e962
children 6bd9d44fc535
files wikked/utils.py
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/wikked/utils.py	Mon Sep 29 07:26:17 2014 -0700
+++ b/wikked/utils.py	Mon Sep 29 13:52:08 2014 -0700
@@ -5,6 +5,7 @@
 from xml.sax.saxutils import escape, unescape
 
 
+re_terminal_path = re.compile(r'[/\\]|(\w\:)')
 endpoint_regex = re.compile(r'(\w[\w\d]*)\:(.*)')
 strip_endpoint_regex = re.compile(r'^(\w[\w\d]+)\:')
 
@@ -42,7 +43,7 @@
                 os.path.isdir(os.path.join(path, '.hg'))):
             return path
         path = os.path.dirname(path)
-        if not path or path == '/':
+        if not path or re_terminal_path.match(path):
             break
     return None