##// END OF EJS Templates
audit: check for casefolding of .hg (issue1450)
Matt Mackall -
r7784:8a217626 default
parent child Browse files
Show More
@@ -815,13 +815,15 b' class path_auditor(object):'
815 return
815 return
816 normpath = os.path.normcase(path)
816 normpath = os.path.normcase(path)
817 parts = splitpath(normpath)
817 parts = splitpath(normpath)
818 if (os.path.splitdrive(path)[0] or parts[0] in ('.hg', '.hg.', '')
818 if (os.path.splitdrive(path)[0]
819 or parts[0].lower() in ('.hg', '.hg.', '')
819 or os.pardir in parts):
820 or os.pardir in parts):
820 raise Abort(_("path contains illegal component: %s") % path)
821 raise Abort(_("path contains illegal component: %s") % path)
821 if '.hg' in path:
822 if '.hg' in path.lower():
823 lparts = [p.lower() for p in parts]
822 for p in '.hg', '.hg.':
824 for p in '.hg', '.hg.':
823 if p in parts[1:-1]:
825 if p in lparts[1:-1]:
824 pos = parts.index(p)
826 pos = lparts.index(p)
825 base = os.path.join(*parts[:pos])
827 base = os.path.join(*parts[:pos])
826 raise Abort(_('path %r is inside repo %r') % (path, base))
828 raise Abort(_('path %r is inside repo %r') % (path, base))
827 def check(prefix):
829 def check(prefix):
General Comments 0
You need to be logged in to leave comments. Login now