Mercurial > hg
comparison mercurial/localrepo.py @ 43734: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 |
comparison
equal
deleted
inserted
replaced
43724:5be128f669d4 | 43734:88a306478556 |
---|---|
2084 # This will have to be fixed before we remove the experimental | 2084 # This will have to be fixed before we remove the experimental |
2085 # gating. | 2085 # gating. |
2086 tracktags(tr2) | 2086 tracktags(tr2) |
2087 repo = reporef() | 2087 repo = reporef() |
2088 | 2088 |
2089 r = repo.ui.configsuboptions( | 2089 singleheadopt = (b'experimental', b'single-head-per-branch') |
2090 b'experimental', b'single-head-per-branch' | 2090 singlehead = repo.ui.configbool(*singleheadopt) |
2091 ) | |
2092 singlehead, singleheadsub = r | |
2093 if singlehead: | 2091 if singlehead: |
2092 singleheadsub = repo.ui.configsuboptions(*singleheadopt)[1] | |
2094 accountclosed = singleheadsub.get( | 2093 accountclosed = singleheadsub.get( |
2095 b"account-closed-heads", False | 2094 b"account-closed-heads", False |
2096 ) | 2095 ) |
2097 scmutil.enforcesinglehead(repo, tr2, desc, accountclosed) | 2096 scmutil.enforcesinglehead(repo, tr2, desc, accountclosed) |
2098 if hook.hashook(repo.ui, b'pretxnclose-bookmark'): | 2097 if hook.hashook(repo.ui, b'pretxnclose-bookmark'): |