mirror of
https://github.com/facebook/sapling.git
synced 2024-12-29 08:02:24 +03:00
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:
parent
c65364ff95
commit
182ec6ae49
@ -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()
|
||||
|
Loading…
Reference in New Issue
Block a user