Skip to content
Snippets Groups Projects
Commit a3b2dc1a authored by Mads Kiilerich's avatar Mads Kiilerich
Browse files

OS X: try cheap ascii .lower() in normcase before making full unicode dance

This is similar to what is done in encoding.lower, introduced in c481761033bd.

This has been seen making 'hg up' and 'hg st' in a 50000+ files repo 13%
faster.

This might make Mercurial slightly slower for users who mainly use non-ASCII
filenames. That is a reasonable trade-off.
parent f0124a65
No related branches found
No related tags found
No related merge requests found
......@@ -195,6 +195,11 @@
def normcase(path):
try:
path.decode('ascii') # throw exception for non-ASCII character
return path.lower()
except UnicodeDecodeError:
pass
try:
u = path.decode('utf-8')
except UnicodeDecodeError:
# percent-encode any characters that don't round-trip
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment