Details
Details
- Reviewers
Alphare - Group Reviewers
hg-reviewers - Commits
- rHG7f5e91cdebcd: match: delete Python 2 conditional code
Diff Detail
Diff Detail
- Repository
- rHG Mercurial
- Branch
- default
- Lint
No Linters Available - Unit
No Unit Test Coverage
( )
Alphare |
hg-reviewers |
No Linters Available |
No Unit Test Coverage |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/match.py (5 lines) |
Commit | Parents | Author | Summary | Date |
---|---|---|---|---|
848d8cc4b017 | c2c219ec28ad | Gregory Szorc | Feb 21 2022, 12:21 PM |
parentdir in prefix_set for parentdir in pathutil.finddirs(path) | parentdir in prefix_set for parentdir in pathutil.finddirs(path) | ||||
) | ) | ||||
# FIXME: Ideally we'd never get to this point if this is the case - we'd | # FIXME: Ideally we'd never get to this point if this is the case - we'd | ||||
# recognize ourselves as an 'always' matcher and skip this. | # recognize ourselves as an 'always' matcher and skip this. | ||||
if b'' in prefix_set: | if b'' in prefix_set: | ||||
return True | return True | ||||
if pycompat.ispy3: | |||||
sl = ord(b'/') | sl = ord(b'/') | ||||
else: | |||||
sl = '/' | |||||
# We already checked that path isn't in prefix_set exactly, so | # We already checked that path isn't in prefix_set exactly, so | ||||
# `path[len(pf)] should never raise IndexError. | # `path[len(pf)] should never raise IndexError. | ||||
return any(path.startswith(pf) and path[len(pf)] == sl for pf in prefix_set) | return any(path.startswith(pf) and path[len(pf)] == sl for pf in prefix_set) | ||||
class patternmatcher(basematcher): | class patternmatcher(basematcher): | ||||
r"""Matches a set of (kind, pat, source) against a 'root' directory. | r"""Matches a set of (kind, pat, source) against a 'root' directory. |