mirror of
https://github.com/facebook/sapling.git
synced 2025-01-08 14:46:47 +03:00
expose a method for checking if hgsql is bypassed
Summary: This commit simply adds a method for checking if the hgsql extension is bypassed. This will be used in a later commit for validating the repository configuration. Reviewed By: DurhamG Differential Revision: D8364386 fbshipit-source-id: 70cc08c55339dc4a47ae17b30c131bbd2167e144
This commit is contained in:
parent
c6f9a0b875
commit
f3e19cba81
@ -108,6 +108,10 @@ class CorruptionException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
def ishgsqlbypassed(ui):
|
||||
return ui.configbool("hgsql", "bypass")
|
||||
|
||||
|
||||
def issqlrepo(repo):
|
||||
return repo.ui.configbool("hgsql", "enabled")
|
||||
|
||||
@ -117,8 +121,9 @@ def cansyncwithsql(repo):
|
||||
|
||||
|
||||
def uisetup(ui):
|
||||
if ui.configbool("hgsql", "bypass"):
|
||||
if ishgsqlbypassed(ui):
|
||||
return
|
||||
|
||||
wrapfunction(localrepo, "newreporequirements", newreporequirements)
|
||||
|
||||
# Enable SQL for local commands that write to the repository.
|
||||
@ -171,7 +176,7 @@ def uisetup(ui):
|
||||
|
||||
|
||||
def extsetup(ui):
|
||||
if ui.configbool("hgsql", "bypass"):
|
||||
if ishgsqlbypassed(ui):
|
||||
return
|
||||
|
||||
if ui.configbool("hgsql", "enabled"):
|
||||
@ -197,7 +202,7 @@ def extsetup(ui):
|
||||
|
||||
|
||||
def reposetup(ui, repo):
|
||||
if ui.configbool("hgsql", "bypass"):
|
||||
if ishgsqlbypassed(ui):
|
||||
return
|
||||
|
||||
if issqlrepo(repo):
|
||||
|
Loading…
Reference in New Issue
Block a user