[PATCH 04 of 13 STABLE V4] icasefs: consider as case sensitive if there is no counterevidence, for safety
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Fri Dec 16 12:27:12 UTC 2011
# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1324037380 -32400
# Branch stable
# Node ID 4708d2c872d99a2881506755d76e20aa5f3474ad
# Parent c5033e2ccf7653deae9995e0ab55e80f696bfa59
icasefs: consider as case sensitive if there is no counterevidence, for safety
for safety, this patch prevents case-less name from misleading into
case insensitivity, even though such names should not be used.
diff -r c5033e2ccf76 -r 4708d2c872d9 mercurial/util.py
--- a/mercurial/util.py Fri Dec 16 21:09:40 2011 +0900
+++ b/mercurial/util.py Fri Dec 16 21:09:40 2011 +0900
@@ -595,9 +595,12 @@
"""
s1 = os.stat(path)
d, b = os.path.split(path)
- p2 = os.path.join(d, b.upper())
- if path == p2:
- p2 = os.path.join(d, b.lower())
+ b2 = b.upper()
+ if b == b2:
+ b2 = b.lower()
+ if b == b2:
+ return True # no evidence against case sensitivity
+ p2 = os.path.join(d, b2)
try:
s2 = os.stat(p2)
if s2 == s1:
More information about the Mercurial-devel
mailing list