diff --git a/mercurial/configitems.py b/mercurial/configitems.py --- a/mercurial/configitems.py +++ b/mercurial/configitems.py @@ -1038,6 +1038,9 @@ coreconfigitem('ui', 'interface.chunkselector', default=None, ) +coreconfigitem('ui', 'localobsolescence', + default=True, +) coreconfigitem('ui', 'logblockedtimes', default=False, ) diff --git a/mercurial/obsolete.py b/mercurial/obsolete.py --- a/mercurial/obsolete.py +++ b/mercurial/obsolete.py @@ -98,6 +98,7 @@ createmarkersopt = 'createmarkers' allowunstableopt = 'allowunstable' exchangeopt = 'exchange' +localonlymodeopt = 'localonly' def _getoptionvalue(repo, option): """Returns True if the given repository has the given obsolete option @@ -139,6 +140,15 @@ createmarkersvalue = _getoptionvalue(repo, createmarkersopt) unstablevalue = _getoptionvalue(repo, allowunstableopt) exchangevalue = _getoptionvalue(repo, exchangeopt) + localonlyvalue = repo.ui.configbool('ui', 'localobsolescence') + + # Evolution options take precedence over local only mode. + if createmarkersvalue or unstablevalue or exchangevalue: + localonlyvalue = False + + # We /could/ have local only mode imply createmarkers, but this would + # have significant implications in core. For now, wait until core + # consumers are aware of local only mode before implying this option. # createmarkers must be enabled if other options are enabled if ((unstablevalue or exchangevalue) and not createmarkersvalue): @@ -149,6 +159,7 @@ createmarkersopt: createmarkersvalue, allowunstableopt: unstablevalue, exchangeopt: exchangevalue, + localonlymodeopt: localonlyvalue, } def isenabled(repo, option):