comparison mercurial/localrepo.py @ 42969:76608f9f27f6

singlehead: introduce special handling of closed heads Until now, the experimental option `single-head-per-branch` was also refusing closed heads. The logic is now ignoring them by default and a suboption have been added to refuse them too `single-head-per-branch:account-closed-heads`.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Wed, 25 Sep 2019 12:59:26 +0200
parents 3df3b139a43d
children 188476e48f51
comparison
equal deleted inserted replaced
42968:86f39a89b63e 42969:76608f9f27f6
1918 # 1918 #
1919 # This will have to be fixed before we remove the experimental 1919 # This will have to be fixed before we remove the experimental
1920 # gating. 1920 # gating.
1921 tracktags(tr2) 1921 tracktags(tr2)
1922 repo = reporef() 1922 repo = reporef()
1923 if repo.ui.configbool('experimental', 'single-head-per-branch'): 1923
1924 scmutil.enforcesinglehead(repo, tr2, desc) 1924 r = repo.ui.configsuboptions('experimental',
1925 'single-head-per-branch')
1926 singlehead, singleheadsub = r
1927 if singlehead:
1928 accountclosed = singleheadsub.get("account-closed-heads", False)
1929 scmutil.enforcesinglehead(repo, tr2, desc, accountclosed)
1925 if hook.hashook(repo.ui, 'pretxnclose-bookmark'): 1930 if hook.hashook(repo.ui, 'pretxnclose-bookmark'):
1926 for name, (old, new) in sorted(tr.changes['bookmarks'].items()): 1931 for name, (old, new) in sorted(tr.changes['bookmarks'].items()):
1927 args = tr.hookargs.copy() 1932 args = tr.hookargs.copy()
1928 args.update(bookmarks.preparehookargs(name, old, new)) 1933 args.update(bookmarks.preparehookargs(name, old, new))
1929 repo.hook('pretxnclose-bookmark', throw=True, 1934 repo.hook('pretxnclose-bookmark', throw=True,