directaccess: disable itself if narrow-heads is enabled

Summary:
If narrow-heads is enabled, commits can all be accessed directly without
using the "directaccess" extension. So let's disable it in that case.

Reviewed By: sfilipco

Differential Revision: D17888725

fbshipit-source-id: 0e316ab86fd5f4eaeb674854619f685058d11ded
This commit is contained in:
Jun Wu 2019-10-11 16:53:55 -07:00 committed by Facebook Github Bot
parent c65364ff95
commit 182ec6ae49

View File

@ -121,6 +121,9 @@ def wrapwithoutwarning(orig, ui, repo, *args, **kwargs):
def uisetup(ui):
""" Change ordering of extensions to ensure that directaccess extsetup comes
after the one of the extensions in the loadsafter list """
# No need to enable directaccess if narrow-heads is enabled.
if ui.configbool("experimental", "narrow-heads"):
return
# internal config: directaccess.loadsafter
loadsafter = ui.configlist("directaccess", "loadsafter")
order = list(extensions._order)
@ -148,6 +151,9 @@ def _repository(orig, *args, **kwargs):
def extsetup(ui):
# No need to enable directaccess if narrow-heads is enabled.
if ui.configbool("experimental", "narrow-heads"):
return
extensions.wrapfunction(revset, "posttreebuilthook", _posttreebuilthook)
extensions.wrapfunction(hg, "repository", _repository)
setupdirectaccess()