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
This commit is contained in:
John Reese 2021-05-04 22:13:57 -07:00 committed by Facebook GitHub Bot
parent 9bee308885
commit 9fd86a4fae
214 changed files with 1860 additions and 661 deletions

View File

@ -235,7 +235,7 @@ class CachedProject(object):
)
def is_cacheable(self):
""" We only cache third party projects """
"""We only cache third party projects"""
return self.cache and self.m.shipit_project is None
def was_cached(self):

View File

@ -148,7 +148,7 @@ class BuildOptions(object):
return self.host_type.is_linux()
def get_context_generator(self, host_tuple=None, facebook_internal=None):
""" Create a manifest ContextGenerator for the specified target platform. """
"""Create a manifest ContextGenerator for the specified target platform."""
if host_tuple is None:
host_type = self.host_type
elif isinstance(host_tuple, HostType):
@ -364,7 +364,7 @@ def _check_host_type(args, host_type):
def setup_build_options(args, host_type=None):
""" Create a BuildOptions object based on the arguments """
"""Create a BuildOptions object based on the arguments"""
fbcode_builder_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
scratch_dir = args.scratch_path

View File

@ -690,7 +690,7 @@ class ArchiveFetcher(Fetcher):
)
def _download_dir(self):
""" returns the download dir, creating it if it doesn't already exist """
"""returns the download dir, creating it if it doesn't already exist"""
download_dir = os.path.dirname(self.file_name)
if not os.path.exists(download_dir):
os.makedirs(download_dir)

View File

@ -16,10 +16,10 @@ from .manifest import ManifestParser
class Loader(object):
""" The loader allows our tests to patch the load operation """
"""The loader allows our tests to patch the load operation"""
def _list_manifests(self, build_opts):
""" Returns a generator that iterates all the available manifests """
"""Returns a generator that iterates all the available manifests"""
for (path, _, files) in os.walk(build_opts.manifests_dir):
for name in files:
# skip hidden files

View File

@ -330,11 +330,11 @@ class ManifestParser(object):
hasher.update(value.encode("utf-8"))
def is_first_party_project(self):
""" returns true if this is an FB first-party project """
"""returns true if this is an FB first-party project"""
return self.shipit_project is not None
def get_required_system_packages(self, ctx):
""" Returns dictionary of packager system -> list of packages """
"""Returns dictionary of packager system -> list of packages"""
return {
"rpm": self.get_section_as_args("rpms", ctx),
"deb": self.get_section_as_args("debs", ctx),

View File

@ -11,7 +11,7 @@ class SubCmd(object):
HELP = None
def run(self, args):
""" perform the command """
"""perform the command"""
return 0
def setup_parser(self, parser):
@ -24,7 +24,7 @@ CmdTable = []
def add_subcommands(parser, common_args, cmd_table=CmdTable):
""" Register parsers for the defined commands with the provided parser """
"""Register parsers for the defined commands with the provided parser"""
for cls in cmd_table:
command = cls()
command_parser = parser.add_parser(

View File

@ -84,7 +84,7 @@ def make_scratch_dir(checkout: EdenCheckout, subdir: Path) -> Path:
def make_temp_dir(repo: Path, subdir: Path) -> Path:
""" TODO(zeyi): This is a temporary measurement before we get mkscratch on Windows"""
"""TODO(zeyi): This is a temporary measurement before we get mkscratch on Windows"""
escaped = os.fsdecode(repo / subdir).replace("\\", "Z").replace("/", "Z")
scratch = WINDOWS_SCRATCH_DIR / escaped
scratch.mkdir(parents=True, exist_ok=True)
@ -592,7 +592,7 @@ def run_cmd_quietly(args, check: bool = True) -> int:
def apply_redirection_configs_to_checkout_config(
checkout: EdenCheckout, redirs: Iterable[Redirection]
) -> CheckoutConfig:
""" Translate the redirections into a new CheckoutConfig """
"""Translate the redirections into a new CheckoutConfig"""
config = checkout.get_config()
redirections = {}

View File

@ -460,5 +460,5 @@ class convert_git(common.converter_source, common.commandline):
return bookmarks
def checkrevformat(self, revstr, mapname="splicemap"):
""" git revision string is a 40 byte hex """
"""git revision string is a 40 byte hex"""
self.checkhexformat(revstr, mapname)

View File

@ -572,5 +572,5 @@ class mercurial_source(common.converter_source):
return bookmarks.listbookmarks(self.repo)
def checkrevformat(self, revstr, mapname="splicemap"):
""" Mercurial, revision string is a 40 byte hex """
"""Mercurial, revision string is a 40 byte hex"""
self.checkhexformat(revstr, mapname)

View File

@ -364,7 +364,7 @@ class gitutil(object):
@classmethod
def _getdifftreepipe(cls, ui, path):
""""""
""" """
if path not in cls.difftreepipes:
cls.difftreepipes[path] = cls._createdifftreepipe(ui, path)
return cls.difftreepipes[path]

View File

@ -615,7 +615,7 @@ class svn_source(converter_source):
return revcommit
def checkrevformat(self, revstr, mapname="splicemap"):
""" fails if revision format does not match the correct format"""
"""fails if revision format does not match the correct format"""
if not re.match(
r"svn:[0-9a-f]{8,8}-[0-9a-f]{4,4}-"
r"[0-9a-f]{4,4}-[0-9a-f]{4,4}-[0-9a-f]"

View File

@ -45,7 +45,7 @@ svn_config = None
def _create_auth_baton(pool):
"""Create a Subversion authentication baton. """
"""Create a Subversion authentication baton."""
import svn.client
# Give the client context baton a suite of authentication

View File

@ -74,7 +74,7 @@ def loadforpath(path):
@command("debugarcconfig")
def debugarcconfig(ui, repo, *args, **opts):
""" exists purely for testing and diagnostic purposes """
"""exists purely for testing and diagnostic purposes"""
try:
config = loadforpath(repo.root)
ui.write(json.dumps(config, sort_keys=True), "\n")

View File

@ -230,7 +230,7 @@ else:
def _win32_strerror(err):
""" expand a win32 error code into a human readable message """
"""expand a win32 error code into a human readable message"""
# FormatMessage will allocate memory and assign it here
buf = ctypes.c_char_p()
@ -310,7 +310,7 @@ class CommandError(WatchmanError):
def is_named_pipe_path(path):
"""Returns True if path is a watchman named pipe path """
"""Returns True if path is a watchman named pipe path"""
return path.startswith("\\\\.\\pipe\\watchman")
@ -351,20 +351,20 @@ class SockPath(object):
class Transport(object):
""" communication transport to the watchman server """
"""communication transport to the watchman server"""
buf = None
def close(self):
""" tear it down """
"""tear it down"""
raise NotImplementedError()
def readBytes(self, size):
""" read size bytes """
"""read size bytes"""
raise NotImplementedError()
def write(self, buf):
""" write some data """
"""write some data"""
raise NotImplementedError()
def setTimeout(self, value):
@ -396,7 +396,7 @@ class Transport(object):
class Codec(object):
""" communication encoding for the watchman server """
"""communication encoding for the watchman server"""
transport = None
@ -414,7 +414,7 @@ class Codec(object):
class SocketTransport(Transport):
""" abstract socket transport """
"""abstract socket transport"""
sock = None
timeout = None
@ -448,7 +448,7 @@ class SocketTransport(Transport):
class UnixSocketTransport(SocketTransport):
""" local unix domain socket transport """
"""local unix domain socket transport"""
def __init__(self, sockpath, timeout):
super(UnixSocketTransport, self).__init__()
@ -466,7 +466,7 @@ class UnixSocketTransport(SocketTransport):
class TcpSocketTransport(SocketTransport):
""" TCP socket transport """
"""TCP socket transport"""
def __init__(self, sockpath, timeout):
super(TcpSocketTransport, self).__init__()
@ -539,7 +539,7 @@ def _get_overlapped_result_ex_impl(pipe, olap, nbytes, millis, alertable):
class WindowsNamedPipeTransport(Transport):
""" connect to a named pipe """
"""connect to a named pipe"""
def __init__(self, sockpath, timeout):
self.sockpath = sockpath
@ -783,7 +783,7 @@ class CLIProcessTransport(Transport):
class BserCodec(Codec):
""" use the BSER encoding. This is the default, preferred codec """
"""use the BSER encoding. This is the default, preferred codec"""
def __init__(self, transport, value_encoding, value_errors):
super(BserCodec, self).__init__(transport)
@ -835,7 +835,7 @@ class ImmutableBserCodec(BserCodec):
class Bser2WithFallbackCodec(BserCodec):
""" use BSER v2 encoding """
"""use BSER v2 encoding"""
def __init__(self, transport, value_encoding, value_errors):
super(Bser2WithFallbackCodec, self).__init__(
@ -905,7 +905,7 @@ class ImmutableBser2Codec(Bser2WithFallbackCodec, ImmutableBserCodec):
class JsonCodec(Codec):
""" Use json codec. This is here primarily for testing purposes """
"""Use json codec. This is here primarily for testing purposes"""
json = None
@ -942,7 +942,7 @@ class JsonCodec(Codec):
class client(object):
""" Handles the communication with the watchman service """
"""Handles the communication with the watchman service"""
sockpath = None
transport = None
@ -1113,7 +1113,7 @@ class client(object):
)
def _connect(self):
""" establish transport connection """
"""establish transport connection"""
if self.recvConn:
if self.pid != os.getpid():
@ -1278,7 +1278,7 @@ class client(object):
raise
def capabilityCheck(self, optional=None, required=None):
""" Perform a server capability check """
"""Perform a server capability check"""
res = self.query(
"version", {"optional": optional or [], "required": required or []}
)

View File

@ -54,7 +54,7 @@ class gpg(object):
return util.filter(data, gpgcmd)
def verify(self, data, sig):
""" returns of the good and bad signatures"""
"""returns of the good and bad signatures"""
sigfile = datafile = None
try:
# create temporary files

View File

@ -503,7 +503,7 @@ class histeditaction(object):
return cls(state, rev)
def verify(self, prev, expected, seen):
""" Verifies semantic correctness of the rule"""
"""Verifies semantic correctness of the rule"""
repo = self.repo
ha = node.hex(self.node)
try:
@ -801,7 +801,7 @@ class edit(histeditaction):
@action(["fold", "f"], _("use commit, but combine it with the one above"))
class fold(histeditaction):
def verify(self, prev, expected, seen):
""" Verifies semantic correctness of the fold rule"""
"""Verifies semantic correctness of the fold rule"""
super(fold, self).verify(prev, expected, seen)
repo = self.repo
if not prev:
@ -1600,7 +1600,7 @@ def ruleeditor(repo, ui, actions, editcomment=""):
def parserules(rules, state):
"""Read the histedit rules string and return list of action objects """
"""Read the histedit rules string and return list of action objects"""
rules = [
l
for l in (r.strip() for r in rules.splitlines())

View File

@ -34,7 +34,7 @@ def readfromstore(self, text):
def filectxisbinary(orig, self):
if self.islfs():
""" Placeholders are always text """
"""Placeholders are always text"""
return False
return orig(self)

View File

@ -68,7 +68,7 @@ DESCRIPTION_REGEX = re.compile(
def graphqlgetdiff(repo, diffid):
"""Resolves a phabricator Diff number to a commit hash of it's latest version """
"""Resolves a phabricator Diff number to a commit hash of it's latest version"""
if util.istest():
hexnode = repo.ui.config("phrevset", "mock-D%s" % diffid)
if hexnode:

View File

@ -869,7 +869,7 @@ class unbundle20(unpackermixin):
def _processallparams(self, paramsblock):
# type: (bytes) -> Dict[str, Optional[str]]
""""""
""" """
params = util.sortdict()
data = pycompat.decodeutf8(paramsblock)
for param in data.split(" "):

View File

@ -917,7 +917,7 @@ def bailifchanged(repo, merge=True, hint=None):
def logmessage(repo, opts):
""" get the log message according to -m and -l option """
"""get the log message according to -m and -l option"""
ui = repo.ui
# Allow the commit message from another commit to be reused.

View File

@ -290,7 +290,7 @@ class server(object):
def getencoding(self):
# type: () -> None
""" writes the current encoding to the result channel """
"""writes the current encoding to the result channel"""
self.cresult.write(pycompat.encodeutf8(encoding.encoding))
def serveone(self):
@ -341,7 +341,7 @@ class server(object):
def _protectio(ui):
# type: (Any) -> Tuple[BinaryIO, ...]
""" duplicates streams and redirect original to null if ui uses stdio """
"""duplicates streams and redirect original to null if ui uses stdio"""
ui.flush()
newfiles = []
nullfd = os.open(os.devnull, os.O_RDWR)
@ -357,7 +357,7 @@ def _protectio(ui):
def _restoreio(ui, fin, fout):
# type: (Any,BinaryIO,BinaryIO) -> None
""" restores streams from duplicated ones """
"""restores streams from duplicated ones"""
ui.flush()
for f, uif in [(fin, ui.fin), (fout, ui.fout)]:
if f is not uif:

View File

@ -324,7 +324,7 @@ class uihunkline(patchnode):
class uihunk(patchnode):
"""ui patch hunk, wraps a hunk and keep track of ui behavior """
"""ui patch hunk, wraps a hunk and keep track of ui behavior"""
maxcontext = 3

View File

@ -203,7 +203,7 @@ def validateconfig(ui):
def codec2iana(cs):
""""""
""" """
cs = email.charset.Charset(cs).input_charset.lower()
# "latin1" normalizes to "iso8859-1", standard calls for "iso-8859-1"

View File

@ -18,11 +18,15 @@ def reposetup(ui, repo):
""" > "abortcommit.py"
sh % "'abspath=`pwd`/abortcommit.py'"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
mq =
abortcommit = $abspath
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init foo"
sh % "cd foo"

View File

@ -10,20 +10,27 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
absorb=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"
sh % "hg debugdrawdag" << r"""
(
sh % "hg debugdrawdag"
<< r"""
C
|
B
|
A
"""
)
sh % "hg debugmakepublic -r A"

View File

@ -15,20 +15,28 @@ from testutil.dott import feature, sh, shlib, testtmp # noqa: F401
sh % "setconfig 'experimental.evolution='"
sh % "enable absorb"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
from edenscm.mercurial import commands, registrar
cmdtable = {}
command = registrar.command(cmdtable)
@command('amend', [], '')
def amend(ui, repo, *pats, **opts):
return 3
""" >> "$TESTTMP/dummyamend.py"
sh % "cat" << r"""
"""
>> "$TESTTMP/dummyamend.py"
)
(
sh % "cat"
<< r"""
[extensions]
amend=$TESTTMP/dummyamend.py
[absorb]
amendflag = correlated
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
def sedi(pattern, *paths):
@ -390,10 +398,14 @@ sh % "hg --config 'absorb.maxstacksize=1' absorb -n" == r"""
# Test obsolete markers creation:
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[experimental]
evolution=createmarkers
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg --config 'absorb.maxstacksize=3' sf -a" == r"""
absorb: only the recent 3 changesets will be analysed
@ -481,10 +493,14 @@ sh % "echo y" | "hg amend --correlated --config 'ui.interactive=1'" == r"""
# Executable files:
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[diff]
git=True
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
if feature.check(["execbit"]):
sh % "newrepo"

View File

@ -10,7 +10,9 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
amend=
undo =
@ -20,12 +22,16 @@ evolution = obsolete
enabled = true
[visibility]
enabled = true
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Create repo
sh % "hg init repo"
sh % "cd repo"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
E
|
C D
@ -34,6 +40,7 @@ B
|
A
"""
)
sh % "rm .hg/localtags"
sh % "hg book -r 2 cat"

View File

@ -11,7 +11,9 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# Set up test environment.
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
amend=
rebase=
@ -22,7 +24,9 @@ enabled=true
record=false
[visibility]
enabled=true
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Test that rebases that cause an orphan commit are not a problem.
sh % "hg init repo"

View File

@ -8,7 +8,9 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
amend=
rebase=
@ -19,7 +21,9 @@ enabled=true
record=false
[visibility]
enabled=true
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"

View File

@ -11,11 +11,15 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# Tests for the automv extension; detect moved files at commit time.
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
automv=
rebase=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Setup repo
@ -294,10 +298,14 @@ sh % "hg status --change . -C" == r"""
# error conditions
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[automv]
similarity=110
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg commit -m 'revision to amend to'" == r"""
abort: automv.similarity must be between 0 and 100
[255]"""

View File

@ -13,7 +13,9 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "newrepo"
sh % "hg debugdrawdag" << r"""
(
sh % "hg debugdrawdag"
<< r"""
J K
|/|
H I
@ -26,6 +28,7 @@ A D
|\|
B C
"""
)
sh % "hg debugbindag -r '::A' -o a.dag"
sh % "hg debugpreviewbindag a.dag" == r"""

View File

@ -550,10 +550,14 @@ sh % "hg up -C ." == "1 files updated, 0 files merged, 0 files removed, 0 files
# Check that bisect does not break on obsolete changesets
# =========================================================
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[experimental]
evolution.createmarkers=True
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# tip is obsolete
# ---------------------

View File

@ -13,13 +13,17 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# Test bookmark -D
sh % "hg init book-D"
sh % "cd book-D"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
amend=
tweakdefaults=
[experimental]
evolution=all
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "hg debugbuilddag '+4*2*2*2'"
sh % "hg bookmark -i -r 1 master"
sh % "hg bookmark -i -r 5 feature1"

View File

@ -246,12 +246,16 @@ sh % "echo 'style ='" >> ".hg/hgrc"
# Add some simple styles to settings
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[templates]
simple = "{rev}\n"
simple2 = {rev}\n
rev = "should not precede {rev} keyword\n"
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "hg log -l1 -Tsimple" == "8"
sh % "hg log -l1 -Tsimple2" == "8"
@ -320,14 +324,18 @@ sh % "hg log -l2 -T./map-myjson" == r"""
# Test docheader, docfooter and separator in [templates] section
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[templates]
myjson = ' {dict(rev, node|short)|json}'
myjson:docheader = '\{\n'
myjson:docfooter = '\n}\n'
myjson:separator = ',\n'
:docheader = 'should not be selected as a docheader for literal templates\n'
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "hg log -l2 -Tmyjson" == r"""
{
{"node": "209edb6a1848", "rev": 8},
@ -2057,10 +2065,14 @@ sh % "hg ci -m 'Modify, add, remove, rename'"
# Check the status template
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
color=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg log -T status -r 10" == r"""
commit: bc9dfec3b3bc
@ -3117,14 +3129,18 @@ sh % "'COLUMNS=25' hg log -l1 --template '{fill(desc, termwidth, \"{node|short}:
sh % 'hg log -l 1 --template \'{sub(r"[0-9]", "-", author)}\'' == "{node|short}"
sh % 'hg log -l 1 --template \'{sub(r"[0-9]", "-", "{node|short}")}\'' == "ea-c-------d"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
color=
[color]
mode=ansi
text.{rev} = red
text.1 = green
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "hg log '--color=always' -l 1 --template '{label(bookmarks, \"text\\n\")}'" == "\\x1b[0;31mtext\\x1b[0m (esc)"
sh % "hg log '--color=always' -l 1 --template '{label(\"text.{rev}\", \"text\\n\")}'" == "\\x1b[0;32mtext\\x1b[0m (esc)"
@ -3242,10 +3258,14 @@ sh % "cd .."
sh % "hg init hashcollision"
sh % "cd hashcollision"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[experimental]
evolution.createmarkers=True
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "echo 0" > "a"
sh % "hg ci -qAm 0"
@ -3423,10 +3443,14 @@ sh % "hg log --template '{rev} Parents: {revset(\"parents(%s)\", rev)}\\n'" == r
1 Parents: 0
0 Parents:"""
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[revsetalias]
myparents(x) = parents(x)
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "hg log --template '{rev} Parents: {revset(\"myparents(%s)\", rev)}\\n'" == r"""
2 Parents: 1
1 Parents: 0
@ -3789,13 +3813,17 @@ sh % pycompat.decodeutf8(
sh % "hg clone -q a aliases"
sh % "cd aliases"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[templatealias]
r = rev
rn = "{r}:{node|short}"
status(c, files) = files % "{c} {file}\n"
utcdate(d) = localdate(d, "UTC")
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "hg debugtemplate -vr0 '{rn} {utcdate(date)|isodate}\\n'" == r"""
(template

View File

@ -11,31 +11,43 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "configure dummyssh"
sh % "enable commitcloud infinitepush"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[commitcloud]
hostname = testhost
servicetype = local
servicelocation = $TESTTMP
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "setconfig 'remotefilelog.reponame=server'"
sh % "hg init server"
sh % "cd server"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[infinitepush]
server = yes
indextype = disk
storetype = disk
reponame = testrepo
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "hg clone 'ssh://user@dummy/server' client -q"
sh % "cd client"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
{ "workspaces_data" : { "workspaces": [ { "name": "user/test/old", "archived": true, "version": 0 }, { "name": "user/test/default", "archived": false, "version": 0 } ] } }
""" >> "$TESTTMP/workspacesdata"
"""
>> "$TESTTMP/workspacesdata"
)
sh % "hg cloud list" == r"""
commitcloud: searching workspaces for the 'server' repo

View File

@ -11,35 +11,47 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "configure dummyssh"
sh % "enable amend commitcloud infinitepush rebase remotenames share"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[infinitepush]
branchpattern = re:scratch/.*
[commitcloud]
hostname = testhost
[experimental]
evolution = createmarkers, allowunstable
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "setconfig 'remotefilelog.reponame=server'"
sh % "hg init server"
sh % "cd server"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[infinitepush]
server = yes
indextype = disk
storetype = disk
reponame = testrepo
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# Make shared part of config
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[commitcloud]
servicetype = local
servicelocation = $TESTTMP
token_enforced = False
education_page = https://someurl.com/wiki/CommitCloud
""" >> "shared.rc"
"""
>> "shared.rc"
)
# Make a clone of the server
sh % "hg clone 'ssh://user@dummy/server' client1 -q"

View File

@ -9,10 +9,14 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
convert=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Prepare orig repo

View File

@ -14,13 +14,16 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "enable rebase"
sh % "newrepo"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
D # A/A=1\n
| # B/A=(removed)
B C # B/Renamed=1\n
|/ # C/A=2\n
A
"""
)
sh % "hg up -q $C"
sh % "hg rebase -r $C -d $D '--config=ui.interactive=1' '--config=experimental.copytrace=off'" << r"""

View File

@ -9,13 +9,16 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "newrepo"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
B # B/dir/B=1
| # B/A=2
| # B/s=x (symlink)
| # B/x= (removed)
A # A/x=1 (executable)
"""
)
# Print paths:

View File

@ -22,26 +22,32 @@ sh.setconfig(
sh.newrepo()
sh.enable("remotenames", "amend")
sh % "hg debugdrawdag" << r"""
(
sh % "hg debugdrawdag"
<< r"""
C
|
B
|
A
"""
)
sh.hg("update", "desc(A)")
sh.hg("bookmark", "foo")
sh.hg("update", "desc(C)")
sh.hg("bookmark", "foo")
sh % "hg debugdrawdag" << r"""
(
sh % "hg debugdrawdag"
<< r"""
E
|
D
|
desc(B)
"""
)
sh.hg("update", "desc(E)")
sh.hg("metaedit", "-mE1")

View File

@ -38,10 +38,14 @@ sh % "hg diff --reverse -r0 -r1" == r"""
+b
+c"""
sh % "cat" << r"""
(
sh % "cat"
<< r"""
g
h
""" >> "a"
"""
>> "a"
)
sh % "hg diff --reverse --nodates" == r"""
diff -r 2855cdcfcbb7 a
--- a/a

View File

@ -42,7 +42,9 @@ sh % "hg debugpathcomplete -n d" == "dira"
sh % "cd .."
sh % "newrepo"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
D # A/filenormal = 1
/ \ # B/filep1 = 1
B C # B/filemerged = 1
@ -50,6 +52,7 @@ B C # B/filemerged = 1
A # C/filemerged = 2
# D/filemerged = 12
"""
)
sh % "hg up -q $D"
sh % "hg debugpathcomplete f" == r"""
filemerged

View File

@ -11,9 +11,12 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# Test various flags to turn off bad hg features.
sh % "newrepo"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
A
"""
)
sh % "hg up -Cq $A"
# Test disabling the `hg merge` command:

View File

@ -212,12 +212,16 @@ sh % 'hg export "not all()"' == r"""
[255]"""
# Check for color output
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[color]
mode = ansi
[extensions]
color =
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg export --color always --nodates tip" == br"""
# HG changeset patch
@ -241,7 +245,9 @@ sh % "hg export --color always --nodates tip" == br"""
sh % "newrepo"
sh % "setconfig diff.git=1"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
# B/foo/3=3\n (copied from bar/1)
# B/foo/1=1\n (copied from bar/1)
# B/bar/2=2\n
@ -249,6 +255,7 @@ sh % "drawdag" << r"""
| # A/bar/1=0\n
A # A/foo/1=0\n
"""
)
sh % "hg export -r 'all()' --pattern 'path:foo'" == r"""
# HG changeset patch

View File

@ -8,10 +8,14 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
arcconfig=$TESTDIR/../edenscm/hgext/extlib/phabricator/arcconfig.py
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Sanity check expectations when there is no arcconfig

View File

@ -8,10 +8,14 @@ from __future__ import absolute_import
from testutil.dott import sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
checkmessagehook=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Build up a repo

View File

@ -11,13 +11,17 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# TODO: Make this test compatibile with obsstore enabled.
sh % "setconfig 'experimental.evolution='"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
rebase=
copytrace=
[experimental]
copytrace=off
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"

View File

@ -16,13 +16,16 @@ sh % "newrepo"
sh % "enable copytrace amend"
sh % "setconfig 'copytrace.draftusefullcopytrace=0' 'experimental.copytrace=off' 'copytrace.fastcopytrace=1' 'experimental.mergedriver=python:$TESTTMP/m.py'"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
B C
|/
A
|
Z
"""
)
sh % "cat" << r"""
def preprocess(ui, repo, hooktype, mergestate, wctx, labels):

View File

@ -9,10 +9,14 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# Set up extension
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
debugcommitmessage=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Set up repo
sh % "hg init repo"

View File

@ -10,11 +10,15 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# Load extensions
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
arcconfig=$TESTDIR/../edenscm/hgext/extlib/phabricator/arcconfig.py
arcdiff=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Diff with no revision

View File

@ -8,20 +8,28 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
dirsync=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[ui]
verbose=true
[dirsync]
sync1.1=dir1/
sync1.2=dir2/subdir/
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# Add multiple files
sh % "mkdir dir1"

View File

@ -11,12 +11,16 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
feature.require(["py2"])
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
fastannotate=
[fastannotate]
mainbranch=main
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"
@ -80,10 +84,14 @@ sh % "hg fastannotate --debug -nf b -r 0" == r"""
sh % "echo a3" >> "a"
sh % "hg commit -m a3"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
b3
b4
""" >> "b"
"""
>> "b"
)
sh % "hg commit -m b4"
sh % "hg bookmark -i main -q"
sh % "hg fastannotate --debug -nf a" == r"""

View File

@ -8,10 +8,14 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
ownercheck=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# ownercheck does not prevent normal hg operations
@ -19,12 +23,16 @@ sh % "hg init repo1"
# make os.getuid return a different, fake uid
sh % "cat" << r"""
(
sh % "cat"
<< r"""
import os
_getuid = os.getuid
def fakeuid(): return _getuid() + 1
os.getuid = fakeuid
""" >> "fakeuid.py"
"""
>> "fakeuid.py"
)
# ownercheck prevents wrong user from creating new repos

View File

@ -8,13 +8,17 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
phrevset=
[paths]
default=dummy://dummy
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"
sh % "echo 1" > "1"

View File

@ -12,7 +12,9 @@ sh % "setconfig \"remotefilelog.cachepath=$TESTTMP/cache\" 'extensions.remotefil
sh % "newrepo"
sh % "echo remotefilelog" >> ".hg/requires"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
E # E/X=1 (renamed from Y)
|
D # D/Y=3 (renamed from X)
@ -21,6 +23,7 @@ B # B/X=2
|
A # A/X=1
"""
)
sh % 'hg bundle --all "$TESTTMP/bundle" --traceback -q'

View File

@ -12,19 +12,27 @@ sh % '. "$TESTDIR/library.sh"'
sh % "hginit master"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
treemanifest=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "cd master"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
[remotefilelog]
server=True
[treemanifest]
server=True
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "mkdir dir"
sh % "echo x" > "dir/x"
sh % "hg commit -qAm x1"
@ -44,10 +52,14 @@ sh % "ls 'shallow/.hg/store/00*.i'" == r"""
sh % "rm -rf shallow"
# Clone with shallowtrees=True
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[remotefilelog]
shallowtrees=True
""" >> "master/.hg/hgrc"
"""
>> "master/.hg/hgrc"
)
sh % "hgcloneshallow 'ssh://user@dummy/master' shallow --noupdate" == r"""
streaming all changes

View File

@ -15,10 +15,14 @@ sh % '. "$TESTDIR/library.sh"'
sh % "hginit master"
sh % "cd master"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[remotefilelog]
server=True
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "echo x" > "x"
sh % "hg commit -qAm x"
sh % "echo y" >> "x"
@ -41,10 +45,14 @@ sh % "hgcloneshallow 'ssh://user@dummy/master' shallow --noupdate" == r"""
no changes found"""
sh % "cd shallow"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
getflogheads=$TESTDIR/getflogheads.py
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# Get heads of a remotefilelog

View File

@ -11,11 +11,15 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'extensions.treemanifest=!'"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
reset=
remotenames=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"

View File

@ -11,12 +11,16 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
reset=
[experimental]
evolution=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"
@ -132,13 +136,17 @@ sh % "hg reset -C 66ee28d0328c" == "1 changeset hidden"
# Reset + Obsolete tests
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
amend=
rebase=
[experimental]
evolution=all
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "touch a"
sh % "hg commit -Aqm a"
sh % "hg log -G -T '{node|short} {bookmarks}\\n'" == r"""

View File

@ -10,13 +10,17 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
amend=
smartlog=
[experimental]
evolution = createmarkers
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Test that changesets with visible precursors are rendered as x's
sh % "hg init repo"

View File

@ -11,11 +11,15 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'extensions.treemanifest=!'"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
smartlog=
remotenames=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"
@ -68,19 +72,27 @@ sh % "hg smartlog -T '{rev} {bookmarks} {remotebookmarks}'" == r"""
o 2 default/master
@ 0 mybook"""
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[smartlog]
repos=default/
names=project/bookmark
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg smartlog -T '{rev} {bookmarks} {remotebookmarks}'" == r"""
o 3 default/project/bookmark
@ 0 mybook"""
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[smartlog]
names=master project/bookmark
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg smartlog -T '{rev} {bookmarks} {remotebookmarks}'" == r"""
o 2 default/master

View File

@ -10,11 +10,14 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "newrepo"
sh % "enable smartlog"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
B C # B has date 100000 0
|/ # C has date 200000 0
A
"""
)
sh % 'hg bookmark -ir "$A" master'
sh % "hg log -r 'smartlog()' -T '{desc}\\n'" == r"""
A

View File

@ -10,12 +10,16 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# Setup
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
arcconfig=$TESTDIR/../edenscm/hgext/extlib/phabricator/arcconfig.py
phabstatus=
smartlog=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"
sh % "touch foo"

View File

@ -14,11 +14,15 @@ sh % '. "$TESTDIR/library.sh"'
sh % "hg init client1"
sh % "cd client1"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[remotefilelog]
reponame=master
cachepath=$CACHEDIR
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "echo a" > "a"
sh % "mkdir dir"

View File

@ -10,7 +10,9 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# test interaction between sparse and treemanifest (sparse file listing)
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
sparse=
treemanifest=
@ -19,7 +21,9 @@ treeonly = True
[remotefilelog]
reponame = master
cachepath = $PWD/hgcache
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Setup the repository

View File

@ -9,13 +9,17 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# Set up
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[experimental]
evolution=all
[extensions]
amend=
tweakdefaults=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Test hg bookmark works with hidden commits

View File

@ -12,12 +12,16 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'experimental.evolution='"
# Set up extensions (order is important here, we must test tweakdefaults loading last)
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
rebase=
remotenames=
tweakdefaults=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Run test
sh % "hg init repo"

View File

@ -13,11 +13,15 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'extensions.treemanifest=!'"
sh.enable("remotenames")
# Set up without remotenames
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
rebase=
tweakdefaults=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "echo a" > "repo/a"

View File

@ -15,12 +15,16 @@ sh % "setconfig 'extensions.treemanifest=!'"
sh % "setconfig 'experimental.evolution='"
# Set up with remotenames
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
rebase=
remotenames=
tweakdefaults=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "echo a" > "repo/a"

View File

@ -10,13 +10,17 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
tweakdefaults=
rebase=
[experimental]
updatecheck=noconflict
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "setconfig 'ui.suggesthgprev=True'"
# Set up the repository.

View File

@ -21,19 +21,27 @@ sh % "setconfig 'extensions.treemanifest=!' 'format.use-zstore-commit-data=0'"
sh % "initserver master master"
sh % "cd master"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
globalrevs=
[globalrevs]
svnrevinteroperation=True
[hgsql]
enabled = True
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[globalrevs]
reponame = customname
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# - Expectation is to fail because pushrebase extension is not enabled.
@ -44,10 +52,14 @@ sh % "hg log -r tip -T '{node}'" == r"""
# - Enable pushrebase extension on the server.
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
pushrebase=
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# - Expectation is to fail because we need to configure pushrebase to only allow
@ -67,10 +79,14 @@ sh % "hg log -r tip -T '{node}' --config 'globalrevs.onlypushrebase=False'" == "
# - Configure server repository to only allow commits created through pushrebase.
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[pushrebase]
blocknonpushrebase = True
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# - Test that the `globalrev` command fails because there is no entry in the
@ -128,11 +144,15 @@ sh % "hg book master"
sh % "cd .."
sh % "initclient client"
sh % "cd client"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
globalrevs=
pushrebase=
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# - Make commits on the client.
@ -185,10 +205,14 @@ sh % "cd ../master"
# - Configure the transaction to always fail before closing on the server.
sh % "cp .hg/hgrc .hg/hgrc.bak"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[hooks]
pretxnclose.error = exit 1
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# - Make some commits on the client.
@ -389,18 +413,26 @@ sh % "cd .."
sh % "initserver master2 master"
sh % "cd master2"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
globalrevs=
pushrebase=
[pushrebase]
blocknonpushrebase=True
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[globalrevs]
reponame = customname
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# - Create a second client corresponding to the second server.
@ -411,11 +443,15 @@ sh % "initclient client2"
sh % "hg pull -q -R client2 'ssh://user@dummy/master2'"
sh % "cd client2"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
globalrevs=
pushrebase=
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# - Make some commits on top of the tip commit on the first client.
@ -603,10 +639,14 @@ sh % "hg log -r m1 -T '{node}\\n'" == "0000000000000000000000000000000000000000"
sh % "cd ../master"
sh % "cp .hg/hgrc.bak .hg/hgrc"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[globalrevs]
readonly = True
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# - Queries not involving writing data to commits should still work.
@ -619,10 +659,14 @@ testlookup()
# - Configure the first server to bypass hgsql extension.
sh % "mv .hg/hgrc.bak .hg/hgrc"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[hgsql]
bypass = True
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# - Queries not involving the hgsql extension should still work.
@ -681,10 +725,14 @@ sh % "firstvalidglobalrevcommit 5010"
# - Configure the repository with `startrev` as 5005.
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[globalrevs]
startrev = 5005
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# - Test that lookup works for commits with globalrev >= `startrev`.

View File

@ -1918,10 +1918,14 @@ sh % "cd .."
# Test --hidden
# (enable obsolete)
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[experimental]
evolution.createmarkers=True
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
node = sh.hg("log", "-r8", "-T{node}")
sh % ("hg debugobsolete '%s'" % node) == ""
@ -2036,12 +2040,16 @@ sh % "cd .."
# change graph edge styling
sh % "cd repo"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[experimental]
graphstyle.parent = |
graphstyle.grandparent = :
graphstyle.missing =
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg log -G -r 'file(\"a\")' -m" == r"""
@ commit: 95fa8febd08a
user: test
@ -2475,12 +2483,16 @@ sh % "'HGPLAIN=1' 'HGPLAINEXCEPT=graph' hg log -G -r 'file(\"a\")' -m" == r"""
# Last 3 lines:
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[experimental]
graphstyle.parent = !
graphstyle.grandparent = 3.
graphstyle.missing =
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg log -G -r '36:18 & file(\"a\")' -m" == r"""
@ commit: 95fa8febd08a
user: test
@ -2553,12 +2565,16 @@ sh % "hg log -G -r '36:18 & file(\"a\")' -m" == r"""
~ ~ summary: (18) merge two known; two far left"""
# All but the first 3 lines:
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[experimental]
graphstyle.parent = !
graphstyle.grandparent = -3.
graphstyle.missing =
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg log -G -r '36:18 & file(\"a\")' -m" == r"""
@ commit: 95fa8febd08a
user: test
@ -2634,13 +2650,17 @@ sh % "cd .."
# Change graph shorten, test better with graphstyle.missing not none
sh % "cd repo"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[experimental]
graphstyle.parent = |
graphstyle.grandparent = :
graphstyle.missing = '
graphshorten = true
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg log -G -r 'file(\"a\")' -m -T '{rev} {desc}'" == r"""
@ 36 (36) buggy merge: identical parents
o 32 (32) expand

View File

@ -15,10 +15,14 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# This test file aims at test topological iteration and the various configuration it can has.
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[ui]
logtemplate={rev}\n
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# On this simple example, all topological branch are displayed in turn until we
# can finally display 0. this implies skipping from 8 to 3 and coming back to 7

View File

@ -17,11 +17,15 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'extensions.treemanifest=!'"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extdiff]
# for portability:
pdiff = sh "$RUNTESTDIR/pdiff"
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Create a repo with some stuff in it:
@ -526,11 +530,14 @@ if False:
# graft with --force (still doesn't graft merges)
sh % "newrepo"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
C D
|/|
A B
"""
)
sh % "hg update -q $C"
sh % "hg graft $B" == 'grafting fc2b737bb2e5 "B"'
sh % "hg rm A B C"
@ -578,9 +585,12 @@ sh % "cat A" == "abc"
# Empty graft
sh % "newrepo"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
A B # B/A=A
"""
)
sh % "hg up -qr $B"
sh % "hg graft $A" == r"""
grafting 426bada5c675 "A"

View File

@ -25,7 +25,9 @@ sh % "cd .."
sh % "initserver master masterrepo"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
from edenscm.mercurial import extensions
from edenscm.mercurial import ui as uimod
def uisetup(ui):
@ -37,14 +39,22 @@ def mylog(orig, self, service, *msg, **opts):
msgstr = msg[0] % msg[1:]
self.warn('%s: %s (%s)\n' % (service, msgstr, kwstr))
return orig(self, service, *msg, **opts)
""" >> "$TESTTMP/uilog.py"
sh % "cat" << r"""
"""
>> "$TESTTMP/uilog.py"
)
(
sh % "cat"
<< r"""
[extensions]
uilog=$TESTTMP/uilog.py
""" >> "master/.hg/hgrc"
"""
>> "master/.hg/hgrc"
)
# Verify timeouts are logged
sh % "cat" << r"""
(
sh % "cat"
<< r"""
from edenscm.mercurial import error, extensions
def uisetup(ui):
hgsql = extensions.find('hgsql')
@ -55,13 +65,19 @@ def fakeenter(orig, self):
return orig(self)
def lockthrow(*args, **kwargs):
raise error.Abort("fake timeout")
""" >> "$TESTTMP/forcetimeout.py"
"""
>> "$TESTTMP/forcetimeout.py"
)
sh % "cp master/.hg/hgrc $TESTTMP/orighgrc"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
forcetimeout=$TESTTMP/forcetimeout.py
""" >> "master/.hg/hgrc"
"""
>> "master/.hg/hgrc"
)
sh % "cd client"
sh % "hg push 'ssh://user@dummy/master'" == r"""
pushing to ssh://user@dummy/master

View File

@ -954,11 +954,14 @@ sh % "hg init headerlikemsg"
sh % "cd headerlikemsg"
sh % "touch empty"
sh % "echo nonempty" >> "nonempty"
sh % "hg ci -qAl -" << r"""
(
sh % "hg ci -qAl -"
<< r"""
blah blah
diff blah
blah blah
"""
)
sh % "hg --config 'diff.git=1' log -pv" == r"""
commit: c6ef204ef767
user: test
@ -1437,10 +1440,14 @@ edenscm.mercurial.cmdutil.extrapreimportmap['foo'] = processfoo
edenscm.mercurial.cmdutil.extrapostimport.append('foo')
edenscm.mercurial.cmdutil.extrapostimportmap['foo'] = postimport
""" > "$TESTTMP/parseextra.py"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
parseextra=$TESTTMP/parseextra.py
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg up -C tip" == "0 files updated, 0 files merged, 0 files removed, 0 files unresolved"
sh % "cat" << r"""
# HG changeset patch

View File

@ -11,13 +11,16 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "newrepo server"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
D
|
B C
|/
A
"""
)
sh % 'hg bookmark -r "desc(B)" master'
# Remote bookmarks should be written even if remotenames is disabled.

View File

@ -38,10 +38,14 @@ def extsetup(ui):
revlog._prereadsize = 8 # use revlog.lazyparser
""" > "commitwrapper.py"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
commitwrapper = `pwd`/commitwrapper.py
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo1"
sh % "cd repo1"

View File

@ -14,7 +14,9 @@ feature.require(["py2"])
# Journal extension test: tests the share extension support
sh % "cat" << r"""
(
sh % "cat"
<< r"""
# mock out util.getuser() and util.makedate() to supply testable values
import os
from edenscm.mercurial import util
@ -34,16 +36,22 @@ def mockmakedate():
util.getuser = mockgetuser
util.makedate = mockmakedate
""" >> "testmocks.py"
"""
>> "testmocks.py"
)
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
journal=
share=
testmocks=`pwd`/testmocks.py
[remotenames]
rename.default=remote
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"

View File

@ -10,14 +10,18 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# Test that journal and lfs wrap the share extension properly
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
journal=
lfs=
[lfs]
threshold=1000B
usercache=$TESTTMP/lfs-cache
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"

View File

@ -10,13 +10,17 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
linkrevcache=
[experimental]
rust-commits=false
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"

View File

@ -13,7 +13,9 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "newrepo"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
C # C/x/3=3
| D # C/x/2=2
|/ # D/x/4=4
@ -21,6 +23,7 @@ B
|
A # A/x/1=1
"""
)
sh % "hg update -q $C"

View File

@ -902,12 +902,16 @@ sh % "cd .."
sh % "hg init follow-dup"
sh % "cd follow-dup"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[ui]
logtemplate = '=== {rev}: {desc}\n'
[diff]
nodates = True
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "echo 0" >> "a"
sh % "hg ci -qAm a0"
sh % "echo 1" >> "a"
@ -1492,10 +1496,14 @@ sh % "hg log -r0 a" == r"""
summary: a"""
# enable obsolete to test hidden feature
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[experimental]
evolution.createmarkers=True
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg log '--template={rev}:{node}\\n'" == r"""
1:a765632148dc55d38c35c4f247c618701886cb2f

View File

@ -32,7 +32,9 @@ def conclude(ui, repo, hooktype, mergestate, wctx, labels=None):
sh % "setconfig 'experimental.mergedriver=python:driver/'"
sh % "hg commit -Aqm driver"
sh % "hg debugdrawdag" << r"""
(
sh % "hg debugdrawdag"
<< r"""
E # E/file = 1\n2\n3\n4\n5
|
D
@ -43,6 +45,7 @@ B
|
A # A/file = 1\n2\n3\n4
"""
)
sh % "hg rebase -s A -d 0" == r"""
rebasing 19c6d3b0d8fb "A" (A)
rebasing 5a83467e1fc3 "B" (B)

View File

@ -42,13 +42,16 @@ sh.newrepo()
sh.setconfig("experimental.metalog=0")
sh.enable("remotenames")
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
C
|
B
|
A
"""
)
# Prepare bookmarks and remotenames. Set them to A in backup, and B on disk.

View File

@ -16,10 +16,14 @@ sh % "cat" << r"""
env | egrep "^HG_USERVAR_(DEBUG|BYPASS_REVIEW)" | sort
exit 0
""" > "$TESTTMP/pretxnchangegroup.sh"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[hooks]
pretxnchangegroup = bash $TESTTMP/pretxnchangegroup.sh
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "hg clone -q repo child"
@ -82,18 +86,26 @@ sh % "hg push --pushvars DEBUG" == r"""
# Test Python hooks
sh % "cat" << r"""
(
sh % "cat"
<< r"""
def hook(ui, repo, hooktype, **kwargs):
for k, v in sorted(kwargs.items()):
if "USERVAR" in k:
ui.write("Got pushvar: %s=%s\n" % (k, v))
""" >> "$TESTTMP/pyhook.py"
"""
>> "$TESTTMP/pyhook.py"
)
sh % 'cp "$HGRCPATH" "$TESTTMP/hgrc.bak"'
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[hooks]
pretxnchangegroup.pyhook = python:$TESTTMP/pyhook.py:hook
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg push --pushvars 'A=1' --pushvars 'B=2'" == r"""
pushing to $TESTTMP/repo
@ -107,11 +119,15 @@ sh % "hg push --pushvars 'A=1' --pushvars 'B=2'" == r"""
sh % 'cp "$TESTTMP/hgrc.bak" "$HGRCPATH"'
# Test pushvars for enforcing push reasons
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[push]
requirereason=True
requirereasonmsg="Because I said so"
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "echo c" >> "a"
sh % "hg commit -Aqm c"
sh % "hg push" == r"""

View File

@ -14,13 +14,17 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'extensions.treemanifest=!'"
# TODO: Make this test compatibile with obsstore enabled.
sh % "setconfig 'experimental.evolution='"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
rebase=
[phases]
publish=False
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init a"

View File

@ -13,13 +13,17 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
# TODO: Make this test compatibile with obsstore enabled.
sh % "setconfig 'experimental.evolution='"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
rebase=
[phases]
publish=False
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init a"

View File

@ -17,14 +17,20 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'experimental.evolution='"
# Test rebase --continue with rebasestate written by legacy client
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
rebase=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"
sh % "hg debugdrawdag" << r"""
(
sh % "hg debugdrawdag"
<< r"""
D H
| |
C G
@ -35,6 +41,7 @@ sh % "hg debugdrawdag" << r"""
\|/
R
"""
)
# rebasestate generated by a legacy client running "hg rebase -r B+D+E+G+H -d Z"

View File

@ -12,14 +12,18 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'extensions.treemanifest=!'"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
rebase=
histedit=
[alias]
tglog = log -G --template "{rev}: {node|short} '{desc}' {branches}\n"
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init a"

View File

@ -8,10 +8,14 @@ from __future__ import absolute_import
from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
remotenames=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Setup repo

View File

@ -11,11 +11,15 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'extensions.treemanifest=!'"
# Set up extension and repos
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
remotenames=
convert=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo1"
sh % "cd repo1"

View File

@ -10,10 +10,14 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "setconfig 'extensions.treemanifest=!'"
# Set up global extensions
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
rebase=
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Create a repo without remotenames
sh % "hg init off"
@ -26,10 +30,14 @@ sh % "cd .."
sh % "hg clone off on" == r"""
updating to branch default
1 files updated, 0 files merged, 0 files removed, 0 files unresolved"""
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
remotenames=
""" >> "on/.hg/hgrc"
"""
>> "on/.hg/hgrc"
)
# Ensure no crashes when working from repo with remotenames on
sh % "hg -R off bookmark foo"
@ -62,10 +70,14 @@ sh % "hg pull ../on" == r"""
searching for changes
no changes found"""
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[paths]
default = $TESTTMP/on
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "hg pull" == r"""
pulling from $TESTTMP/on

View File

@ -16,7 +16,9 @@ sh % 'setconfig experimental.narrow-heads=true visibility.enabled=true mutation.
# Test restack behavior with old stacks.
sh % "newrepo"
sh % "drawdag" << r"""
(
sh % "drawdag"
<< r"""
D2 # amend: D1 -> D2
/ # (This suggests a rebase from E1 to D2)
M
@ -32,6 +34,7 @@ M
|/ # (This suggests a rebase from C1 to B2)
A
"""
)
sh % 'hg debugremotebookmark master "$M"'
sh % 'hg up -q "$D2"'

View File

@ -216,7 +216,9 @@ sh % "cat e" == "321"
sh % "touch -t 200001010000 e"
sh % "hg debugrebuildstate"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[fakedirstatewritetime]
# emulate invoking dirstate.write() via repo.status()
# at 2000-01-01 00:00
@ -224,12 +226,18 @@ fakenow = 2000-01-01 00:00:00
[extensions]
fakedirstatewritetime = $TESTDIR/fakedirstatewritetime.py
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "hg revert -r 0 e"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
fakedirstatewritetime = !
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "cat e" == "123"
sh % "touch -t 200001010000 e"

View File

@ -9,13 +9,16 @@ from testutil.dott import feature, sh, testtmp # noqa: F401
sh % "hg init"
sh % "hg debugdrawdag" << r"""
(
sh % "hg debugdrawdag"
<< r"""
C
|
B
|
A
"""
)
sh % "setconfig 'devel.legacy.revnum=warn'"

View File

@ -39,10 +39,14 @@ def r3232(repo, subset, x):
edenscm.mercurial.revset.symbols['r3232'] = r3232
''' > "testrevset.py"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
testrevset=$TESTTMP/testrevset.py
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
def _try(*args):
@ -120,10 +124,14 @@ def debugrevlistspec(ui, repo, fmt, *args, **opts):
for c in revs:
ui.write("%s\n" % c)
""" > "debugrevlistspec.py"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
debugrevlistspec = $TESTTMP/debugrevlistspec.py
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init repo"
sh % "cd repo"
@ -1790,10 +1798,14 @@ sh % "cd .."
sh % "hg init wdir-hashcollision"
sh % "cd wdir-hashcollision"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[experimental]
evolution.createmarkers=True
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "echo 0" > "a"
sh % "hg ci -qAm 0"
@ -2459,12 +2471,16 @@ sh % "cd .."
sh % "hg init sorting"
sh % "cd sorting"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[ui]
logtemplate = '{rev} {branch|p5}{desc|p5}{author|p5}{date|hgdate}\n'
[templatealias]
p5(s) = pad(s, 5)
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "setbranch b12"
sh % "commit -m m111 -u u112 -d '111 10800'"
sh % "setbranch b11"

View File

@ -32,9 +32,12 @@ sh % "enable treemanifest remotenames remotefilelog pushrebase"
# Check manifest behavior with empty commit
sh % "hginit emptycommit"
sh % "cd emptycommit"
sh % "drawdag" << r""" # drawdag.defaultfiles=false
(
sh % "drawdag"
<< r""" # drawdag.defaultfiles=false
A
"""
)
eq(
listcommitandmanifesthashes("$A::"),
[("A", "7b3f3d5e5faf", "0000000000000000000000000000000000000000")],
@ -49,7 +52,9 @@ sh % "cd $TESTTMP/localcommitsandmerge"
# C, D - add + modify
# E - merge with conflict and divergence
# F - just checking that merge doesn't mess repo by performing a modify
sh % "drawdag" << r""" # drawdag.defaultfiles=false
(
sh % "drawdag"
<< r""" # drawdag.defaultfiles=false
F # F/y/c=f # crash with rustmanifest if y/c=c
|
E # E/y/d=(removed)
@ -62,6 +67,7 @@ B # B/x/b=b
|
A # A/x/a=a
"""
)
eq(
listcommitandmanifesthashes("$A::"),
[
@ -84,17 +90,24 @@ sh % "hg cat -r $F x/a x/b y/c" == "dbf"
# to a server doing pushrebase
sh % "hginit $TESTTMP/serverpushrebasemerge"
sh % "cd $TESTTMP/serverpushrebasemerge"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
pushrebase=
[remotefilelog]
server=True
[treemanifest]
server=True
""" >> ".hg/hgrc"
sh % "drawdag" << r""" # drawdag.defaultfiles=false
"""
>> ".hg/hgrc"
)
(
sh % "drawdag"
<< r""" # drawdag.defaultfiles=false
A # A/x/a=a
"""
)
sh % "hg bookmark master -r $A"
eq(
listcommitandmanifesthashes("$A::"),
@ -105,11 +118,15 @@ sh % "hg clone 'ssh://user@dummy/serverpushrebasemerge' $TESTTMP/clientpushrebas
fetching tree '' 7607ba5a97e3117540bbb7525093678eb26e374f, found via bd99ff0a074c
2 trees fetched over 0.00s"""
sh % "cd $TESTTMP/clientpushrebasemerge"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[treemanifest]
sendtrees=True
treeonly=True
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "drawdag" << r""" # drawdag.defaultfiles=false
F # F/y/c=f # crash with rustmanifest if y/c=c
|

View File

@ -10,11 +10,15 @@ from testutil.dott import sh, testtmp # noqa: F401
# Share works with blackbox enabled:
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
blackbox =
share =
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg init a"
sh % "hg share a b" == r"""

View File

@ -16,7 +16,9 @@ from edenscm.mercurial import extensions, hg, obsolete
from testutil.dott import feature, sh, shlib, testtmp # noqa: F401
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
strip =
shelve=
@ -27,7 +29,9 @@ qnew = --date '0 0'
maxbackups = 2
[experimental]
evolution=createmarkers
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
# Make sure obs-based shelve can be used with an empty repo
sh % 'cd "$TESTTMP"'
@ -727,10 +731,14 @@ sh % "hg shelve --delete --name NAME" == r"""
[255]"""
# Test interactive shelve
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[ui]
interactive = true
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "echo a" >> "a/b"
sh % "cat a/a" >> "a/b"
sh % "echo x" >> "a/b"
@ -893,11 +901,15 @@ if feature.check("false"):
echo "===="
""" > "$TESTTMP/checkvisibility.sh"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[defaults]
# to fix hash id of temporary revisions
unshelve = --date '0 0'
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
# "hg unshelve"implies steps below:
# (1) commit changes in the working directory
@ -909,10 +921,14 @@ if feature.check("false"):
# == test visibility to external preupdate hook
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[hooks]
preupdate.visibility = sh $TESTTMP/checkvisibility.sh preupdate
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "echo nnnn" >> "n"
@ -939,10 +955,14 @@ if feature.check("false"):
ACTUAL 47f190a8b2e0
===="""
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[hooks]
preupdate.visibility =
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % 'sh "$TESTTMP/checkvisibility.sh" after-unshelving' == r"""
==== after-unshelving:
@ -954,10 +974,14 @@ if feature.check("false"):
sh % "hg update -q -C unshelvedest"
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[hooks]
update.visibility = sh $TESTTMP/checkvisibility.sh update
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % "echo nnnn" >> "n"
@ -985,10 +1009,14 @@ if feature.check("false"):
ACTUAL 47f190a8b2e0
===="""
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[hooks]
update.visibility =
""" >> ".hg/hgrc"
"""
>> ".hg/hgrc"
)
sh % 'sh "$TESTTMP/checkvisibility.sh" after-unshelving' == r"""
==== after-unshelving:
@ -1049,12 +1077,16 @@ sh % "cd .."
# Keep active bookmark while (un)shelving even on shared repo (issue4940)
# -----------------------------------------------------------------------
sh % "cat" << r"""
(
sh % "cat"
<< r"""
[extensions]
share =
[experimnetal]
evolution=createmarkers
""" >> "$HGRCPATH"
"""
>> "$HGRCPATH"
)
sh % "hg bookmarks -R obsrepo" == " test a72d63c69876"
sh % "hg share -B obsrepo obsshare" == r"""
updating working directory

Some files were not shown because too many files have changed in this diff Show More