Mercurial > hg
comparison mercurial/localrepo.py @ 46096:4d5e2fd53707
singlehead: introduce option to restrict to public changes
The new experimental.single-head-per-branch:public-changes-only option
restricts the single-head-per-branch filter to public changesets. This
is useful when serving one repository with different views as publishing
and non-publishing repository.
Differential Revision: https://phab.mercurial-scm.org/D9525
author | Joerg Sonnenberger <joerg@bec.de> |
---|---|
date | Sat, 05 Dec 2020 23:35:55 +0100 |
parents | 49b4ab1d9f5e |
children | c6ae1982b2a1 |
comparison
equal
deleted
inserted
replaced
46095:93e09d370003 | 46096:4d5e2fd53707 |
---|---|
2252 if singlehead: | 2252 if singlehead: |
2253 singleheadsub = repo.ui.configsuboptions(*singleheadopt)[1] | 2253 singleheadsub = repo.ui.configsuboptions(*singleheadopt)[1] |
2254 accountclosed = singleheadsub.get( | 2254 accountclosed = singleheadsub.get( |
2255 b"account-closed-heads", False | 2255 b"account-closed-heads", False |
2256 ) | 2256 ) |
2257 scmutil.enforcesinglehead(repo, tr2, desc, accountclosed) | 2257 if singleheadsub.get(b"public-changes-only", False): |
2258 filtername = b"immutable" | |
2259 else: | |
2260 filtername = b"visible" | |
2261 scmutil.enforcesinglehead( | |
2262 repo, tr2, desc, accountclosed, filtername | |
2263 ) | |
2258 if hook.hashook(repo.ui, b'pretxnclose-bookmark'): | 2264 if hook.hashook(repo.ui, b'pretxnclose-bookmark'): |
2259 for name, (old, new) in sorted( | 2265 for name, (old, new) in sorted( |
2260 tr.changes[b'bookmarks'].items() | 2266 tr.changes[b'bookmarks'].items() |
2261 ): | 2267 ): |
2262 args = tr.hookargs.copy() | 2268 args = tr.hookargs.copy() |