2020-07-02 14:47:30 +03:00
|
|
|
# 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
|
|
|
|
|
|
|
|
|
2020-08-17 12:40:58 +03:00
|
|
|
sh % "configure dummyssh"
|
|
|
|
sh % "enable commitcloud infinitepush"
|
|
|
|
|
2021-05-05 08:13:57 +03:00
|
|
|
(
|
|
|
|
sh % "cat"
|
|
|
|
<< r"""
|
2020-07-02 14:47:30 +03:00
|
|
|
[commitcloud]
|
|
|
|
hostname = testhost
|
|
|
|
servicetype = local
|
|
|
|
servicelocation = $TESTTMP
|
2021-05-05 08:13:57 +03:00
|
|
|
"""
|
|
|
|
>> "$HGRCPATH"
|
|
|
|
)
|
2020-07-02 14:47:30 +03:00
|
|
|
|
|
|
|
sh % "setconfig 'remotefilelog.reponame=server'"
|
|
|
|
sh % "hg init server"
|
|
|
|
sh % "cd server"
|
2021-05-05 08:13:57 +03:00
|
|
|
(
|
|
|
|
sh % "cat"
|
|
|
|
<< r"""
|
2020-07-02 14:47:30 +03:00
|
|
|
[infinitepush]
|
|
|
|
server = yes
|
|
|
|
indextype = disk
|
|
|
|
storetype = disk
|
|
|
|
reponame = testrepo
|
2021-05-05 08:13:57 +03:00
|
|
|
"""
|
|
|
|
>> ".hg/hgrc"
|
|
|
|
)
|
2020-07-02 14:47:30 +03:00
|
|
|
|
|
|
|
sh % "hg clone 'ssh://user@dummy/server' client -q"
|
|
|
|
sh % "cd client"
|
|
|
|
|
|
|
|
|
2021-05-05 08:13:57 +03:00
|
|
|
(
|
|
|
|
sh % "cat"
|
|
|
|
<< r"""
|
2020-07-30 14:53:38 +03:00
|
|
|
{ "workspaces_data" : { "workspaces": [ { "name": "user/test/old", "archived": true, "version": 0 }, { "name": "user/test/default", "archived": false, "version": 0 } ] } }
|
2021-05-05 08:13:57 +03:00
|
|
|
"""
|
|
|
|
>> "$TESTTMP/workspacesdata"
|
|
|
|
)
|
2020-07-29 19:46:36 +03:00
|
|
|
|
2020-07-02 14:47:30 +03:00
|
|
|
sh % "hg cloud list" == r"""
|
2020-07-30 16:08:42 +03:00
|
|
|
commitcloud: searching workspaces for the 'server' repo
|
2020-09-11 13:44:13 +03:00
|
|
|
the following commitcloud workspaces are available:
|
2020-07-02 14:47:30 +03:00
|
|
|
default
|
|
|
|
run `hg cloud sl -w <workspace name>` to view the commits
|
2020-09-10 00:02:56 +03:00
|
|
|
run `hg cloud switch -w <workspace name>` to switch to a different workspace
|
2020-08-21 13:32:32 +03:00
|
|
|
run `hg cloud list --all` to list all workspaces, including deleted
|
2020-07-02 14:47:30 +03:00
|
|
|
"""
|
2020-07-29 19:46:36 +03:00
|
|
|
|
2020-07-02 14:47:30 +03:00
|
|
|
sh % "hg cloud list --all" == r"""
|
2020-07-30 16:08:42 +03:00
|
|
|
commitcloud: searching workspaces for the 'server' repo
|
2020-09-11 13:44:13 +03:00
|
|
|
the following commitcloud workspaces are available:
|
2020-07-02 14:47:30 +03:00
|
|
|
default
|
2020-08-04 15:14:54 +03:00
|
|
|
old (archived)
|
2020-07-02 14:47:30 +03:00
|
|
|
run `hg cloud sl -w <workspace name>` to view the commits
|
2020-09-10 00:02:56 +03:00
|
|
|
run `hg cloud switch -w <workspace name>` to switch to a different workspace
|
2020-07-02 14:47:30 +03:00
|
|
|
"""
|
2020-08-04 15:14:54 +03:00
|
|
|
|
|
|
|
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
|
2020-09-11 13:44:13 +03:00
|
|
|
the following commitcloud workspaces are available:
|
2020-08-04 15:14:54 +03:00
|
|
|
old (archived)
|
|
|
|
default (archived)
|
|
|
|
run `hg cloud sl -w <workspace name>` to view the commits
|
2020-09-10 00:02:56 +03:00
|
|
|
run `hg cloud switch -w <workspace name>` to switch to a different workspace
|
2020-08-04 15:14:54 +03:00
|
|
|
"""
|
|
|
|
|
|
|
|
sh % "hg cloud list" == r"""
|
|
|
|
commitcloud: searching workspaces for the 'server' repo
|
|
|
|
no active workspaces found with the prefix user/test/
|
|
|
|
"""
|
2020-08-21 13:32:32 +03:00
|
|
|
|
|
|
|
sh % "hg cloud undelete -w default" == r"""
|
|
|
|
commitcloud: workspace user/test/default has been restored
|
|
|
|
"""
|
|
|
|
|
|
|
|
sh % "hg cloud list" == r"""
|
|
|
|
commitcloud: searching workspaces for the 'server' repo
|
2020-09-11 13:44:13 +03:00
|
|
|
the following commitcloud workspaces are available:
|
2020-08-21 13:32:32 +03:00
|
|
|
default
|
|
|
|
run `hg cloud sl -w <workspace name>` to view the commits
|
2020-09-10 00:02:56 +03:00
|
|
|
run `hg cloud switch -w <workspace name>` to switch to a different workspace
|
2020-08-21 13:32:32 +03:00
|
|
|
run `hg cloud list --all` to list all workspaces, including deleted
|
|
|
|
"""
|
|
|
|
|
|
|
|
sh % "hg cloud undelete -w old" == r"""
|
|
|
|
commitcloud: workspace user/test/old has been restored
|
|
|
|
"""
|
|
|
|
|
|
|
|
sh % "hg cloud list" == r"""
|
|
|
|
commitcloud: searching workspaces for the 'server' repo
|
2020-09-11 13:44:13 +03:00
|
|
|
the following commitcloud workspaces are available:
|
2020-08-21 13:32:32 +03:00
|
|
|
default
|
|
|
|
old
|
|
|
|
run `hg cloud sl -w <workspace name>` to view the commits
|
2020-09-10 00:02:56 +03:00
|
|
|
run `hg cloud switch -w <workspace name>` to switch to a different workspace
|
2020-08-21 13:32:32 +03:00
|
|
|
"""
|