sapling/eden/scm/tests/test-commitcloud-list-workspaces-t.py
Liubov Dmitrieva 6f8fc0e3a2 implement command to list workspaces
Summary:
New Commit Cloud command to list user's own worspaces in Commit Cloud

hg cloud ls

Reviewed By: markbt

Differential Revision: D22308127

fbshipit-source-id: 756c419a9bb3d6f50ddd5b4dd344cd35b9a02d2d
2020-07-02 04:49:06 -07:00

52 lines
1.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 % "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 }, { "name": "user/test/default", "archived": false } ] } }
""" >> "$TESTTMP/userworkspacesdata"
sh % "hg cloud list" == r"""
workspaces:
default
run `hg cloud sl -w <workspace name>` to view the commits
"""
sh % "hg cloud list --all" == r"""
workspaces:
old (archived)
default
run `hg cloud sl -w <workspace name>` to view the commits
"""