Mercurial > public > mercurial-scm > hg
comparison mercurial/sparse.py @ 37576:6ef94f24aa82
py3: make sure we open file in bytes mode
Differential Revision: https://phab.mercurial-scm.org/D3274
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Wed, 11 Apr 2018 22:36:16 +0530 |
parents | 7a1806e0daea |
children | 8fe62ad9f4ff |
comparison
equal
deleted
inserted
replaced
37575:230eb9594150 | 37576:6ef94f24aa82 |
---|---|
577 | 577 |
578 # Import rules on top; only take in rules that are not yet | 578 # Import rules on top; only take in rules that are not yet |
579 # part of the active rules. | 579 # part of the active rules. |
580 changed = False | 580 changed = False |
581 for p in paths: | 581 for p in paths: |
582 with util.posixfile(util.expandpath(p)) as fh: | 582 with util.posixfile(util.expandpath(p), mode='rb') as fh: |
583 raw = fh.read() | 583 raw = fh.read() |
584 | 584 |
585 iincludes, iexcludes, iprofiles = parseconfig(repo.ui, raw) | 585 iincludes, iexcludes, iprofiles = parseconfig(repo.ui, raw) |
586 oldsize = len(includes) + len(excludes) + len(profiles) | 586 oldsize = len(includes) + len(excludes) + len(profiles) |
587 includes.update(iincludes - aincludes) | 587 includes.update(iincludes - aincludes) |