mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
77b76f2884
Summary: This feature should be similar to `hg cloud deletebackup` but for cloud sync It is needed to deprecate old backups. Reviewed By: markbt Differential Revision: D22876332 fbshipit-source-id: 90527bac4f352dc14fadf8b04f6c2df01045f5ce
81 lines
2.1 KiB
Python
81 lines
2.1 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.
|
|
|
|
from __future__ import absolute_import
|
|
|
|
from testutil.dott import feature, sh, testtmp # noqa: F401
|
|
|
|
|
|
sh % "cat" << r"""
|
|
[ui]
|
|
ssh = python "$TESTDIR/dummyssh"
|
|
[extensions]
|
|
commitcloud =
|
|
infinitepush =
|
|
[commitcloud]
|
|
hostname = testhost
|
|
servicetype = local
|
|
servicelocation = $TESTTMP
|
|
""" >> "$HGRCPATH"
|
|
|
|
sh % "setconfig 'remotefilelog.reponame=server'"
|
|
sh % "hg init server"
|
|
sh % "cd server"
|
|
sh % "cat" << r"""
|
|
[infinitepush]
|
|
server = yes
|
|
indextype = disk
|
|
storetype = disk
|
|
reponame = testrepo
|
|
""" >> ".hg/hgrc"
|
|
|
|
sh % "hg clone 'ssh://user@dummy/server' client -q"
|
|
sh % "cd client"
|
|
|
|
|
|
sh % "cat" << r"""
|
|
{ "workspaces_data" : { "workspaces": [ { "name": "user/test/old", "archived": true, "version": 0 }, { "name": "user/test/default", "archived": false, "version": 0 } ] } }
|
|
""" >> "$TESTTMP/workspacesdata"
|
|
|
|
sh % "hg cloud list" == r"""
|
|
commitcloud: searching workspaces for the 'server' repo
|
|
workspaces:
|
|
default
|
|
run `hg cloud sl -w <workspace name>` to view the commits
|
|
run `hg cloud join -w <workspace name> --switch` to switch to a different workspace
|
|
"""
|
|
|
|
sh % "hg cloud list --all" == r"""
|
|
commitcloud: searching workspaces for the 'server' repo
|
|
workspaces:
|
|
default
|
|
old (archived)
|
|
run `hg cloud sl -w <workspace name>` to view the commits
|
|
run `hg cloud join -w <workspace name> --switch` to switch to a different workspace
|
|
"""
|
|
|
|
sh % "hg cloud delete -w default" == r"""
|
|
commitcloud: workspace user/test/default has been deleted
|
|
"""
|
|
|
|
sh % "hg cloud delete -w default_abc" == r"""
|
|
abort: unknown workspace: user/test/default_abc
|
|
[255]
|
|
"""
|
|
|
|
sh % "hg cloud list --all" == r"""
|
|
commitcloud: searching workspaces for the 'server' repo
|
|
workspaces:
|
|
old (archived)
|
|
default (archived)
|
|
run `hg cloud sl -w <workspace name>` to view the commits
|
|
run `hg cloud join -w <workspace name> --switch` to switch to a different workspace
|
|
"""
|
|
|
|
sh % "hg cloud list" == r"""
|
|
commitcloud: searching workspaces for the 'server' repo
|
|
no active workspaces found with the prefix user/test/
|
|
"""
|