Mercurial > hg
comparison mercurial/match.py @ 31403:10c17f8bfcf3
py3: open file in rb mode
author | Rishabh Madan <rishabhmadan96@gmail.com> |
---|---|
date | Wed, 15 Mar 2017 14:51:18 +0530 |
parents | 6168d4b93634 |
children | 40704098853f |
comparison
equal
deleted
inserted
replaced
31402:ea0395eec67b | 31403:10c17f8bfcf3 |
---|---|
740 syntaxes = {'re': 'relre:', 'regexp': 'relre:', 'glob': 'relglob:', | 740 syntaxes = {'re': 'relre:', 'regexp': 'relre:', 'glob': 'relglob:', |
741 'include': 'include', 'subinclude': 'subinclude'} | 741 'include': 'include', 'subinclude': 'subinclude'} |
742 syntax = 'relre:' | 742 syntax = 'relre:' |
743 patterns = [] | 743 patterns = [] |
744 | 744 |
745 fp = open(filepath) | 745 fp = open(filepath, 'rb') |
746 for lineno, line in enumerate(util.iterfile(fp), start=1): | 746 for lineno, line in enumerate(util.iterfile(fp), start=1): |
747 if "#" in line: | 747 if "#" in line: |
748 global _commentre | 748 global _commentre |
749 if not _commentre: | 749 if not _commentre: |
750 _commentre = util.re.compile(r'((?:^|[^\\])(?:\\\\)*)#.*') | 750 _commentre = util.re.compile(r'((?:^|[^\\])(?:\\\\)*)#.*') |