Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/pathutil.py @ 44255:d84420232492
pathauditor: drop a redundant call to bytes.lower()
`_lowerclean(s)` calls `s.lower()`, so we don't need to do that before
calling it.
Differential Revision: https://phab.mercurial-scm.org/D8001
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Fri, 24 Jan 2020 17:10:45 -0800 |
parents | 0b7733719d21 |
children | 51c86c6167c1 |
comparison
equal
deleted
inserted
replaced
44254:293cab97a766 | 44255:d84420232492 |
---|---|
82 if last.isdigit() and first.upper() in [b"HG", b"HG8B6C"]: | 82 if last.isdigit() and first.upper() in [b"HG", b"HG8B6C"]: |
83 raise error.Abort( | 83 raise error.Abort( |
84 _(b"path contains illegal component: %s") % path | 84 _(b"path contains illegal component: %s") % path |
85 ) | 85 ) |
86 if b'.hg' in _lowerclean(path): | 86 if b'.hg' in _lowerclean(path): |
87 lparts = [_lowerclean(p.lower()) for p in parts] | 87 lparts = [_lowerclean(p) for p in parts] |
88 for p in b'.hg', b'.hg.': | 88 for p in b'.hg', b'.hg.': |
89 if p in lparts[1:]: | 89 if p in lparts[1:]: |
90 pos = lparts.index(p) | 90 pos = lparts.index(p) |
91 base = os.path.join(*parts[:pos]) | 91 base = os.path.join(*parts[:pos]) |
92 raise error.Abort( | 92 raise error.Abort( |