2018-01-23 23:08:29 +03:00
|
|
|
# sparse.py - shim that redirects to load fbsparse
|
|
|
|
#
|
|
|
|
# Copyright 2014 Facebook, Inc.
|
|
|
|
#
|
|
|
|
# This software may be used and distributed according to the terms of the
|
|
|
|
# GNU General Public License version 2 or any later version.
|
|
|
|
"""allow sparse checkouts of the working directory
|
|
|
|
"""
|
|
|
|
from __future__ import absolute_import
|
|
|
|
|
2018-01-23 23:08:42 +03:00
|
|
|
from . import fbsparse
|
2018-01-23 23:08:29 +03:00
|
|
|
|
|
|
|
cmdtable = fbsparse.cmdtable.copy()
|
|
|
|
|
|
|
|
def _fbsparseexists(ui):
|
|
|
|
with ui.configoverride({("devel", "all-warnings"): False}):
|
|
|
|
return not ui.config('extensions', 'fbsparse', '!').startswith('!')
|
|
|
|
|
|
|
|
def uisetup(ui):
|
|
|
|
if _fbsparseexists(ui):
|
|
|
|
cmdtable.clear()
|
|
|
|
return
|
|
|
|
fbsparse.uisetup(ui)
|
|
|
|
|
|
|
|
def extsetup(ui):
|
|
|
|
if _fbsparseexists(ui):
|
|
|
|
cmdtable.clear()
|
|
|
|
return
|
|
|
|
fbsparse.extsetup(ui)
|
|
|
|
|
|
|
|
def reposetup(ui, repo):
|
|
|
|
if _fbsparseexists(ui):
|
|
|
|
return
|
|
|
|
fbsparse.reposetup(ui, repo)
|