Mercurial > hg
comparison hgext/git/dirstate.py @ 49078:020328be00cb
git: un-byteify the `mode` argument for the builtin `open()`
I guess this was assuming `pycompat.open` was imported, but it's not here or
elsewhere in the git extension.
Differential Revision: https://phab.mercurial-scm.org/D12568
author | Matt Harbison <matt_harbison@yahoo.com> |
---|---|
date | Mon, 18 Apr 2022 14:20:58 -0400 |
parents | 20d151e43429 |
children | 2e726c934fcd |
comparison
equal
deleted
inserted
replaced
49077:20d151e43429 | 49078:020328be00cb |
---|---|
31 def readpatternfile(orig, filepath, warn, sourceinfo=False): | 31 def readpatternfile(orig, filepath, warn, sourceinfo=False): |
32 if not (b'info/exclude' in filepath or filepath.endswith(b'.gitignore')): | 32 if not (b'info/exclude' in filepath or filepath.endswith(b'.gitignore')): |
33 return orig(filepath, warn, sourceinfo=False) | 33 return orig(filepath, warn, sourceinfo=False) |
34 result = [] | 34 result = [] |
35 warnings = [] | 35 warnings = [] |
36 with open(filepath, b'rb') as fp: | 36 with open(filepath, 'rb') as fp: |
37 for l in fp: | 37 for l in fp: |
38 l = l.strip() | 38 l = l.strip() |
39 if not l or l.startswith(b'#'): | 39 if not l or l.startswith(b'#'): |
40 continue | 40 continue |
41 if l.startswith(b'!'): | 41 if l.startswith(b'!'): |