##// END OF EJS Templates
icasefs: use util.normcase() instead of str.lower() or os.path.normpath()
FUJIWARA Katsunori -
r15637:7f01ad70 stable
parent child Browse files
Show More
@@ -7,7 +7,7 b''
7 7
8 8 from node import nullid, nullrev, hex, bin
9 9 from i18n import _
10 import scmutil, util, filemerge, copies, subrepo, encoding
10 import scmutil, util, filemerge, copies, subrepo
11 11 import errno, os, shutil
12 12
13 13 class mergestate(object):
@@ -100,7 +100,7 b' def _checkcollision(mctx):'
100 100 "check for case folding collisions in the destination context"
101 101 folded = {}
102 102 for fn in mctx:
103 fold = encoding.lower(fn)
103 fold = util.normcase(fn)
104 104 if fold in folded:
105 105 raise util.Abort(_("case-folding collision between %s and %s")
106 106 % (fn, folded[fold]))
@@ -140,7 +140,7 b' def realpath(path):'
140 140 '''
141 141 # TODO: There may be a more clever way to do this that also handles other,
142 142 # less common file systems.
143 return os.path.normpath(os.path.normcase(os.path.realpath(path)))
143 return os.path.normpath(normcase(os.path.realpath(path)))
144 144
145 145 def samestat(s1, s2):
146 146 return False
@@ -216,17 +216,16 b' def findexe(command):'
216 216 def statfiles(files):
217 217 '''Stat each file in files and yield stat or None if file does not exist.
218 218 Cluster and cache stat per directory to minimize number of OS stat calls.'''
219 ncase = os.path.normcase
220 219 dircache = {} # dirname -> filename -> status | None if file does not exist
221 220 for nf in files:
222 nf = ncase(nf)
221 nf = normcase(nf)
223 222 dir, base = os.path.split(nf)
224 223 if not dir:
225 224 dir = '.'
226 225 cache = dircache.get(dir, None)
227 226 if cache is None:
228 227 try:
229 dmap = dict([(ncase(n), s)
228 dmap = dict([(normcase(n), s)
230 229 for n, k, s in osutil.listdir(dir, True)])
231 230 except OSError, err:
232 231 # handle directory not found in Python version prior to 2.5
General Comments 0
You need to be logged in to leave comments. Login now