sapling/eden/scm/tests/test-fb-hgext-tweakdefaults-pullrebaseremotenames-t.py
Jun Wu 2a99866d7b codemod: update license headers
Summary:
The "Portions" license cannot be updated automatically. So this is a manual
update using:

  sd -s 'Portions Copyright (c) Facebook, Inc. and its affiliates.' 'Portions Copyright (c) Meta Platforms, Inc. and affiliates.' `rg -l Facebook`
  sd -s 'Copyright (c) Facebook, Inc. and its affiliates.' 'Copyright (c) Meta Platforms, Inc. and affiliates.' `rg -l Facebook`

Differential Revision: D33420114

fbshipit-source-id: 49ae00a7b62e3b8cc6c5dd839b3c104a75e72a56
2022-01-05 14:43:32 -08:00

67 lines
1.6 KiB
Python

# coding=utf-8
# Copyright (c) Meta Platforms, Inc. and 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 % "configure modernclient"
# Set up with remotenames
(
sh % "cat"
<< r"""
[extensions]
rebase=
remotenames=
tweakdefaults=
"""
>> "$HGRCPATH"
)
sh % "newclientrepo repo"
sh % "cd .."
sh % "echo a" > "repo/a"
sh % "hg -R repo commit -qAm a"
sh % "hg -R repo bookmark master"
sh % "hg -R repo push -q -r . --to book --create"
sh % "newclientrepo clone test:repo_server book"
# Pull --rebase with no local changes
sh % "hg bookmark localbookmark -t book"
sh % "echo b" > "../repo/b"
sh % "hg -R ../repo commit -qAm b"
sh % "hg -R ../repo push -q -r . --to book"
sh % "hg pull --rebase" == r"""
pulling from test:repo_server
searching for changes
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
nothing to rebase - fast-forwarded to book"""
sh % "hg log -G -T '{desc}: {bookmarks}'" == r"""
@ b: localbookmark
o a:"""
# Make a local commit and check pull --rebase still works.
sh % "echo x" > "x"
sh % "hg commit -qAm x"
sh % "echo c" > "../repo/c"
sh % "hg -R ../repo commit -qAm c"
sh % "hg -R ../repo push -q -r . --to book"
sh % "hg pull --rebase" == r"""
pulling from test:repo_server
searching for changes
rebasing 86d71924e1d0 "x" (localbookmark)"""
sh % "hg log -G -T '{desc}: {bookmarks}'" == r"""
@ x: localbookmark
o c:
o b:
o a:"""