Mercurial > hg-stable
diff mercurial/localrepo.py @ 43441:88a306478556 stable
singlehead: making config item a bool again
with the use of `configsuboptions`, the main config item has become
a string (unless it's just the default value).
This makes it in particular hard to override in a cascade of HGRC files,
as we do in Heptapod to re-allow multiple heads on specific repositories
while the default behaviour is to forbid them. The added test case reflects
that use-case
author | Georges Racinet <georges.racinet@octobus.net> |
---|---|
date | Wed, 20 Nov 2019 19:07:02 +0100 |
parents | c5bcd946a34b |
children | 7eb701e355bd |
line wrap: on
line diff
--- a/mercurial/localrepo.py Thu Nov 21 17:25:24 2019 -0500 +++ b/mercurial/localrepo.py Wed Nov 20 19:07:02 2019 +0100 @@ -2086,11 +2086,10 @@ tracktags(tr2) repo = reporef() - r = repo.ui.configsuboptions( - b'experimental', b'single-head-per-branch' - ) - singlehead, singleheadsub = r + singleheadopt = (b'experimental', b'single-head-per-branch') + singlehead = repo.ui.configbool(*singleheadopt) if singlehead: + singleheadsub = repo.ui.configsuboptions(*singleheadopt)[1] accountclosed = singleheadsub.get( b"account-closed-heads", False )