comparison mercurial/match.py @ 48884:7f5e91cdebcd

match: delete Python 2 conditional code Differential Revision: https://phab.mercurial-scm.org/D12287
author Gregory Szorc <gregory.szorc@gmail.com>
date Mon, 21 Feb 2022 10:21:18 -0700
parents 6000f5b25c9b
children f254fc73d956
comparison
equal deleted inserted replaced
48883:f0c445a8e324 48884:7f5e91cdebcd
581 # FIXME: Ideally we'd never get to this point if this is the case - we'd 581 # FIXME: Ideally we'd never get to this point if this is the case - we'd
582 # recognize ourselves as an 'always' matcher and skip this. 582 # recognize ourselves as an 'always' matcher and skip this.
583 if b'' in prefix_set: 583 if b'' in prefix_set:
584 return True 584 return True
585 585
586 if pycompat.ispy3: 586 sl = ord(b'/')
587 sl = ord(b'/')
588 else:
589 sl = '/'
590 587
591 # We already checked that path isn't in prefix_set exactly, so 588 # We already checked that path isn't in prefix_set exactly, so
592 # `path[len(pf)] should never raise IndexError. 589 # `path[len(pf)] should never raise IndexError.
593 return any(path.startswith(pf) and path[len(pf)] == sl for pf in prefix_set) 590 return any(path.startswith(pf) and path[len(pf)] == sl for pf in prefix_set)
594 591