[PATCH 1 of 3 STABLE] windows: force specified path to be audited in localpath form

FUJIWARA Katsunori foozy at lares.dti.ne.jp
Sat Dec 24 04:09:57 CST 2011


# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1324720867 -32400
# Branch stable
# Node ID 4751d5133f15931407b6c8cb3af5aeaf4ca1aeb5
# Parent  32a6e00e4cfe84573b9d4dc71155d0dc23b75faf
windows: force specified path to be audited in localpath form

pathauditor is invoked not only for localpath form using "os.sep" as
separator, but also for normalized form using "/": for example, hg
internal path like "store/data" under ".hg", or ones normalized by
match object

this causes insufficient repository nesting check, because current
pathauditor implementation divides specified path into components by
"os.sep", and this causes to treat multiple path components joined by
"/" as single one on Windows environment.

this patch applies "util.localpath()" on specified path to force it to
be divided into components correctly.

in fact, root for pathauditor also uses multiple path separator on
Windows. but this does not affect audit itself, so "util.localpath()"
is not applied on it.

diff -r 32a6e00e4cfe -r 4751d5133f15 mercurial/scmutil.py
--- a/mercurial/scmutil.py	Tue Dec 20 14:11:14 2011 -0600
+++ b/mercurial/scmutil.py	Sat Dec 24 19:01:07 2011 +0900
@@ -85,6 +85,7 @@
         '''Check the relative path.
         path may contain a pattern (e.g. foodir/**.txt)'''
 
+        path = util.localpath(path)
         normpath = self.normcase(path)
         if normpath in self.audited:
             return


More information about the Mercurial-devel mailing list