mirror of
https://github.com/facebook/sapling.git
synced 2024-12-28 15:44:27 +03:00
archive: block full archives in large repositories
Summary: The default archive behavior archives the entire working copy. That is undesirable and easy to accidentally trigger in a large repository. Let's prevent it and require users to specify what they want archived. Reviewed By: quark-zju Differential Revision: D23464818 fbshipit-source-id: c39a631d618c2007e442e691cda542400cf8f4c3
This commit is contained in:
parent
b8e197fdb4
commit
537d5858bd
@ -594,6 +594,13 @@ def archive(ui, repo, dest, **opts):
|
||||
|
||||
prefix = cmdutil.makefilename(repo, prefix, node)
|
||||
match = scmutil.match(ctx, [], opts)
|
||||
if repo.ui.configbool("scale", "largeworkingcopy") and match.always():
|
||||
raise error.Abort(
|
||||
_(
|
||||
"this repository has a very large working copy and "
|
||||
"requires an explicit set of files to be archived"
|
||||
)
|
||||
)
|
||||
archival.archive(repo, dest, node, kind, not opts.get("no_decode"), match, prefix)
|
||||
|
||||
|
||||
|
@ -178,3 +178,10 @@ configured as GMT.
|
||||
456789012
|
||||
|
||||
$ cd ..
|
||||
|
||||
Disallow default archive in repositories with large working copies
|
||||
|
||||
$ hg -R test archive --config scale.largeworkingcopy=True result.zip
|
||||
abort: this repository has a very large working copy and requires an explicit set of files to be archived
|
||||
[255]
|
||||
$ hg -R test archive --config scale.largeworkingcopy=True -I 'relglob:**' result.zip
|
||||
|
Loading…
Reference in New Issue
Block a user