mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
f1afaa9ae4
Summary: Migrate some Python tests to use narrow-heads. Reviewed By: DurhamG Differential Revision: D22130167 fbshipit-source-id: 5cc71711b5bc674daed5040909e7cd141b7a9cfc
51 lines
1.7 KiB
Python
51 lines
1.7 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 or any later version.
|
|
|
|
from __future__ import absolute_import
|
|
|
|
from testutil.dott import feature, sh, testtmp # noqa: F401
|
|
|
|
|
|
sh % "enable remotenames"
|
|
|
|
# Test that hg debugstrip -B stops at remotenames
|
|
sh % "hg init server"
|
|
sh % "hg clone -q server client"
|
|
sh % "cd client"
|
|
sh % "echo x" > "x"
|
|
sh % "hg commit -Aqm a"
|
|
sh % "echo a" > "a"
|
|
sh % "hg commit -Aqm aa"
|
|
sh % "hg debugmakepublic"
|
|
sh % "hg push -q --to master --create"
|
|
sh % "echo b" > "b"
|
|
sh % "hg commit -Aqm bb"
|
|
sh % "hg book foo"
|
|
sh % "hg log -T '{desc} ({bookmarks}) ({remotebookmarks})\\n'" == r"""
|
|
bb (foo) ()
|
|
aa () (default/master public/a6e72781733c178cd290a07022bb6c8460749e7b)
|
|
a () ()"""
|
|
sh % "hg debugstrip -qB foo" == "bookmark 'foo' deleted"
|
|
sh % "hg log -T '{desc} ({bookmarks}) ({remotebookmarks})\\n'" == r"""
|
|
aa () (default/master public/a6e72781733c178cd290a07022bb6c8460749e7b)
|
|
a () ()"""
|
|
|
|
# Test that hg debugstrip -B deletes bookmark even if there is a remote bookmark,
|
|
# but doesn't delete the commit.
|
|
sh % "hg init server"
|
|
sh % "hg clone -q server client"
|
|
sh % "cd client"
|
|
sh % "echo x" > "x"
|
|
sh % "hg commit -Aqm a"
|
|
sh % "hg debugmakepublic"
|
|
sh % "hg push -q --to master --create"
|
|
sh % "hg book foo"
|
|
sh % "hg log -T '{desc} ({bookmarks}) ({remotebookmarks})\\n'" == "a (foo) (default/master public/770eb8fce608e2c55f853a8a5ea328b659d70616)"
|
|
sh % "hg debugstrip -qB foo" == r"""
|
|
bookmark 'foo' deleted
|
|
abort: empty revision set
|
|
[255]"""
|
|
sh % "hg log -T '{desc} ({bookmarks}) ({remotebookmarks})\\n'" == "a () (default/master public/770eb8fce608e2c55f853a8a5ea328b659d70616)"
|