comparison mercurial/store.py @ 34213:96808804b68f

store: give name to lowerencode function lambda function isn't easy to track in traceback.
author Yuya Nishihara <yuya@tcha.org>
date Sun, 03 Sep 2017 17:26:10 +0900
parents 414a3513c2bd
children 7e3f078b6f31
comparison
equal deleted inserted replaced
34212:dfd009e5f9f2 34213:96808804b68f
160 cmap = dict([(chr(x), chr(x)) for x in xrange(127)]) 160 cmap = dict([(chr(x), chr(x)) for x in xrange(127)])
161 for x in _reserved(): 161 for x in _reserved():
162 cmap[chr(x)] = "~%02x" % x 162 cmap[chr(x)] = "~%02x" % x
163 for x in range(ord("A"), ord("Z") + 1): 163 for x in range(ord("A"), ord("Z") + 1):
164 cmap[chr(x)] = chr(x).lower() 164 cmap[chr(x)] = chr(x).lower()
165 return lambda s: "".join([cmap[c] for c in s]) 165 def lowerencode(s):
166 return "".join([cmap[c] for c in s])
167 return lowerencode
166 168
167 lowerencode = getattr(parsers, 'lowerencode', None) or _buildlowerencodefun() 169 lowerencode = getattr(parsers, 'lowerencode', None) or _buildlowerencodefun()
168 170
169 # Windows reserved names: con, prn, aux, nul, com1..com9, lpt1..lpt9 171 # Windows reserved names: con, prn, aux, nul, com1..com9, lpt1..lpt9
170 _winres3 = ('aux', 'con', 'prn', 'nul') # length 3 172 _winres3 = ('aux', 'con', 'prn', 'nul') # length 3