mirror of
https://github.com/facebook/sapling.git
synced 2024-12-29 08:02:24 +03:00
51720717d8
Summary: Some of our upcoming repo merges will make it infeasible for someone to use a full checkout. Let's add a config that will warn users of this. It has a few levels, starting with a suppressable hint, then a non-suppressable warning, then a suppressable exception, then a non-suppressable exception. Reviewed By: ikostia Differential Revision: D19974408 fbshipit-source-id: bad35a477ad8626dbc0977465368f5d71007e2d5
41 lines
1.5 KiB
Python
41 lines
1.5 KiB
Python
# Copyright (c) Facebook, Inc. and its affiliates.
|
|
#
|
|
# This software may be used and distributed according to the terms of the
|
|
# GNU General Public License version 2 or any later version.
|
|
|
|
from __future__ import absolute_import
|
|
|
|
from testutil.dott import feature, sh, testtmp # noqa: F401
|
|
|
|
|
|
sh % "enable sparse"
|
|
sh % "newrepo"
|
|
sh % "touch file"
|
|
sh % "hg commit -Aqm 'add file'"
|
|
|
|
sh % "setconfig sparse.warnfullcheckout=hint"
|
|
sh % "hg status" == r"""
|
|
hint[sparse-fullcheckout]: warning: full checkouts will eventually be disabled in this repository. Use EdenFS or hg sparse to get a smaller repository.
|
|
hint[hint-ack]: use 'hg hint --ack sparse-fullcheckout' to silence these hints"""
|
|
|
|
sh % "setconfig sparse.warnfullcheckout=warn"
|
|
sh % "hg status" == "warning: full checkouts will soon be disabled in this repository. Use EdenFS or hg sparse to get a smaller repository."
|
|
|
|
sh % "setconfig sparse.warnfullcheckout=softblock"
|
|
sh % "hg status" == r"""
|
|
abort: full checkouts are not supported for this repository
|
|
(use EdenFS or hg sparse)
|
|
[255]"""
|
|
|
|
sh % "setconfig sparse.bypassfullcheckoutwarn=True"
|
|
sh % "hg status" == "warning: full checkouts will soon be disabled in this repository. Use EdenFS or hg sparse to get a smaller repository."
|
|
|
|
sh % "setconfig sparse.warnfullcheckout=hardblock"
|
|
sh % "hg status" == r"""
|
|
abort: full checkouts are not supported for this repository
|
|
(use EdenFS or hg sparse)
|
|
[255]"""
|
|
|
|
sh % "hg sparse include file" == ""
|
|
sh % "hg status" == ""
|