[PATCH 4 of 5] Fix not to split by os.sep directlly

Shun-ichi Goto shunichi.goto at gmail.com
Sun Jan 6 06:26:15 CST 2008


# HG changeset patch
# User Shun-ichi GOTO <shunichi.goto at gmail.com>
# Date 1199621805 -32400
# Node ID d7ca5e5a28f64de466b50fe19f8d77908714c496
# Parent  e7739db328e05cf824c8d5f3bf6d694e15bb0d02
Fix not to split by os.sep directlly.

This is required for workaround of 0x5c issue.

diff -r e7739db328e0 -r d7ca5e5a28f6 mercurial/util.py
--- a/mercurial/util.py	Sun Jan 06 21:16:25 2008 +0900
+++ b/mercurial/util.py	Sun Jan 06 21:16:45 2008 +0900
@@ -713,10 +713,11 @@ class path_auditor(object):
                       os.path.isdir(os.path.join(curpath, '.hg'))):
                     raise Abort(_('path %r is inside repo %r') %
                                 (path, prefix))
-
+        parts = list(parts)
+        parts.pop()
         prefixes = []
-        for c in strutil.rfindall(normpath, os.sep):
-            prefix = normpath[:c]
+        for n in range(len(parts)):
+            prefix = os.sep.join(parts)
             if prefix in self.auditeddir:
                 break
             check(prefix)


More information about the Mercurial-devel mailing list