Mercurial > public > mercurial-scm > hg-stable
diff mercurial/scmutil.py @ 46097: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 | 1bf2b44c4007 |
children | be3d8178251e |
line wrap: on
line diff
--- a/mercurial/scmutil.py Thu Dec 03 14:39:39 2020 -0800 +++ b/mercurial/scmutil.py Sat Dec 05 23:35:55 2020 +0100 @@ -2189,12 +2189,12 @@ return _(b"%s and %d others") % (first, len(nodes) - maxnumnodes) -def enforcesinglehead(repo, tr, desc, accountclosed=False): +def enforcesinglehead(repo, tr, desc, accountclosed, filtername): """check that no named branch has multiple heads""" if desc in (b'strip', b'repair'): # skip the logic during strip return - visible = repo.filtered(b'visible') + visible = repo.filtered(filtername) # possible improvement: we could restrict the check to affected branch bm = visible.branchmap() for name in bm: