sapling/eden/scm/tests/test-commitcloud-list-workspaces-t.py
John Reese 9fd86a4fae apply upgraded black 21.4b2 formatting to fbsource
Summary:
This applies the formatting changes from black v21.4b2 to all covered
projects in fbsource. Most changes are to single line docstrings, as black
will now remove leading and trailing whitespace to match PEP8. Any other
formatting changes are likely due to files that landed without formatting,
or files that previously triggered errors in black.

Any changes to code should be AST identical. Any test failures are likely
due to bad tests, or testing against the output of pyfmt.

Reviewed By: thatch

Differential Revision: D28204910

fbshipit-source-id: 804725bcd14f763e90c5ddff1d0418117c15809a
2021-05-04 22:16:51 -07:00

118 lines
3.2 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 % "configure dummyssh"
sh % "enable commitcloud infinitepush"
(
sh % "cat"
<< r"""
[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
the following commitcloud workspaces are available:
default
run `hg cloud sl -w <workspace name>` to view the commits
run `hg cloud switch -w <workspace name>` to switch to a different workspace
run `hg cloud list --all` to list all workspaces, including deleted
"""
sh % "hg cloud list --all" == r"""
commitcloud: searching workspaces for the 'server' repo
the following commitcloud workspaces are available:
default
old (archived)
run `hg cloud sl -w <workspace name>` to view the commits
run `hg cloud switch -w <workspace name>` 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
the following commitcloud workspaces are available:
old (archived)
default (archived)
run `hg cloud sl -w <workspace name>` to view the commits
run `hg cloud switch -w <workspace name>` 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/
"""
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
the following commitcloud workspaces are available:
default
run `hg cloud sl -w <workspace name>` to view the commits
run `hg cloud switch -w <workspace name>` to switch to a different workspace
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
the following commitcloud workspaces are available:
default
old
run `hg cloud sl -w <workspace name>` to view the commits
run `hg cloud switch -w <workspace name>` to switch to a different workspace
"""