Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 44124:d56a2d6f34f0
hgrc: introduce HGRCSKIPREPO to skip reading the repository's hgrc
We had a way to change the behavior regarding reading the global and user
config, but we had nothing regarding the repository hgrc itself.
This option is useful in situation where scripts need to be able to work around
strange configuration set by the user in his repository. (and were HGPLAIN is
not enough).
Differential Revision: https://phab.mercurial-scm.org/D7807
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Tue, 07 Jan 2020 11:24:05 +0100 |
parents | 5a012404503b |
children | 238790674d69 |
comparison
equal
deleted
inserted
replaced
44123:52f8b07ad2f9 | 44124:d56a2d6f34f0 |
---|---|
674 | 674 |
675 Extensions should monkeypatch this function to modify how per-repo | 675 Extensions should monkeypatch this function to modify how per-repo |
676 configs are loaded. For example, an extension may wish to pull in | 676 configs are loaded. For example, an extension may wish to pull in |
677 configs from alternate files or sources. | 677 configs from alternate files or sources. |
678 """ | 678 """ |
679 if b'HGRCSKIPREPO' in encoding.environ: | |
680 return False | |
679 try: | 681 try: |
680 ui.readconfig(hgvfs.join(b'hgrc'), root=wdirvfs.base) | 682 ui.readconfig(hgvfs.join(b'hgrc'), root=wdirvfs.base) |
681 return True | 683 return True |
682 except IOError: | 684 except IOError: |
683 return False | 685 return False |