コード例 #1
0
from __future__ import absolute_import

from testutil.dott import feature, sh, testtmp  # noqa: F401

sh % "setconfig treemanifest.flatcompat=0"

sh % "enable amend rebase"
sh % "setconfig 'rebase.singletransaction=True'"
sh % "setconfig 'experimental.copytrace=off'"
sh % "setconfig 'rebase.experimental.inmemory=1'"
sh % "setconfig 'rebase.experimental.inmemory.nomergedriver=False'"
sh % "setconfig 'rebase.experimental.inmemorywarning=rebasing in-memory!'"

for userustmanifest in [True, False]:
    sh.cd(testtmp.TESTTMP)
    sh.setconfig("treemanifest.rustmanifest=%s" % int(userustmanifest))

    # Create a commit with a move + content change:
    sh % "newrepo"
    sh % "echo 'original content'" > "file"
    sh % "hg add -q"
    sh % "hg commit -q -m base"
    sh % "echo 'new content'" > "file"
    sh % "hg mv file file_new"
    sh % "hg commit -m a"
    sh % "hg book -r . a"

    # Recreate the same commit:
    sh % "hg up -q '.~1'"
    sh % "echo 'new content'" > "file"
    sh % "hg mv file file_new"
コード例 #2
0
sh % "drawdag" << r"""
H
|
G
|
desc(B)
"""

# Migrate up (double-writes to zstore and 00changelog.d).

sh % "setconfig format.use-zstore-commit-data=on"
sh % 'hg log -r "$H" -T "{desc}\\n"' == "H"

# Test the revlog-fallback mode migrates draft commits.

sh.setconfig("format.use-zstore-commit-data=off")

sh % "newrepo"
sh % "drawdag" << r"""
B
|
A
""" == ""

# Make A public.
sh.hg("debugremotebookmark", "master", "desc(A)")
sh % "hg log -r 'public()' -T '{desc} '" == "A"
sh % "hg log -r 'draft()' -T '{desc} '" == "B"

# Migrate.
sh.setconfig(
コード例 #3
0
# 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")
sh.setconfig("infinitepush.branchpattern=re:draft.*", "visibility.enabled=1")

sh.newrepo("server")
sh.setconfig("treemanifest.server=1")

sh % "drawdag" << r"""
B C
|/
A
"""

sh % "hg log -Gr 'all()' -T '{desc} {node}'" == r"""
    o  C dc0947a82db884575bb76ea10ac97b08536bfa03
    |
    | o  B 112478962961147124edd43549aedd1a335e44bf
    |/
    o  A 426bada5c67598ca65036d57d9e4b64b0c1ce7a0"""

sh % 'hg book -r "$A" book/a'
sh % 'hg book -r "$B" book/b'
sh % 'hg book -r "$C" draft/c'
コード例 #4
0
    """Set bookmarks to specified commit"""
    sh.hg("bookmark", "book", "-r", "desc(%s)" % name)
    sh.hg("debugremotebookmark", "remotebook", "desc(%s)" % name)


def listbookmarks():
    """List local and remote bookmarks"""
    local = sh.hg("log", "-r", sh.hg("bookmarks", "-T", "{node}"), "-T{desc}")
    remote = sh.hg(
        "log", "-r", sh.hg("bookmarks", "--remote", "-T", "{node}"), "-T{desc}"
    )
    return [local, remote]


sh.newrepo()
sh.setconfig("experimental.metalog=0")
sh.enable("remotenames")

(
    sh % "drawdag"
    << r"""
C
|
B
|
A
"""
)

# Prepare bookmarks and remotenames. Set them to A in backup, and B on disk.
コード例 #5
0
ファイル: test-debugmetalog-t.py プロジェクト: simpkins/eden
# 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.

from __future__ import absolute_import

from testutil.dott import feature, sh, testtmp  # noqa: F401


sh.setconfig(
    "visibility.enabled=true",
    "experimental.narrow-heads=1",
    "remotenames.selectivepull=1",
    "mutation.date=0 0",
    # Do not track config changes to stabilize the test a bit.
    "metalog.track-config=0",
)
sh.newrepo()
sh.enable("remotenames", "amend")

(
    sh % "hg debugdrawdag"
    << r"""
C
|
B
|
A
"""
コード例 #6
0
# 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.setconfig(
    "experimental.metalog=1",
    "visibility.enabled=true",
    "experimental.narrow-heads=1",
    "remotenames.selectivepull=1",
)
sh.newrepo()
sh.enable("remotenames", "amend")

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")
コード例 #7
0
# 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.setconfig(
    "experimental.metalog=1",
    "visibility.enabled=true",
    "experimental.narrow-heads=1",
    "remotenames.selectivepull=1",
    "mutation.date=0 0",
    "hint.ack-graph-renderer=true",
)
sh.newrepo()
sh.enable("remotenames", "amend")

sh % "hg debugdrawdag" << r"""
C
|
B
|
A
"""

sh.hg("update", "desc(A)")
sh.hg("bookmark", "foo")
sh.hg("update", "desc(C)")