sapling/eden/hg-server/tests/test-debugmetalog-t.py
Durham Goode 98d9269874 server: copy hg to a new hg-server directory
Summary:
Create a fork of the Mercurial code that we can use to build server
rpms. The hg servers will continue to exist for a few more months while we move
the darkstorm and ediscovery use cases off them. In the mean time, we want to
start making breaking changes to the client, so let's create a stable copy of
the hg code to produce rpms for the hg servers.

The fork is based off c7770c78d, the latest hg release.

This copies the files as is, then adds some minor tweaks to get it to build:
- Disables some lint checks that appear to be bypassed by path
- sed replace eden/scm with eden/hg-server
- Removed a dependency on scm/telemetry from the edenfs-client tests since
  scm/telemetry pulls in the original eden/scm/lib/configparser which conflicts
  with the hg-server conflict parser.

allow-large-files

Reviewed By: quark-zju

Differential Revision: D27632557

fbshipit-source-id: b2f442f4ec000ea08e4d62de068750832198e1f4
2021-04-09 10:09:06 -07:00

107 lines
4.1 KiB
Python

# coding=utf-8
# 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",
# 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
"""
sh.hg("update", "desc(A)")
sh.hg("bookmark", "foo")
sh.hg("update", "desc(C)")
sh.hg("bookmark", "foo")
sh % "hg debugdrawdag" << r"""
E
|
D
|
desc(B)
"""
sh.hg("update", "desc(E)")
sh.hg("metaedit", "-mE1")
sh % "hg debugmetalog" == r"""
@ 25b25cf4a935 E1
│ 1970-01-01 00:00:00 +0000: E (added by metaedit -mE1)
│ 1970-01-01 00:00:00 +0000: . (added by metaedit -mE1)
│ x a6c8ab8ac0c6 E
├─╯ 1970-01-01 00:00:00 +0000: E (removed by metaedit -mE1)
│ 1970-01-01 00:00:00 +0000: E (added by debugdrawdag)
│ 1970-01-01 00:00:00 +0000: . (removed by metaedit -mE1)
│ 1970-01-01 00:00:00 +0000: . (added by debugdrawdag)
o be0ef73c17ad D
│ 1970-01-01 00:00:00 +0000: D (added by debugdrawdag)
│ 1970-01-01 00:00:00 +0000: . (removed by debugdrawdag)
│ 1970-01-01 00:00:00 +0000: . (added by debugdrawdag)
│ o 26805aba1e60 C
├─╯ 1970-01-01 00:00:00 +0000: foo (added by bookmark foo)
│ 1970-01-01 00:00:00 +0000: C (added by debugdrawdag)
│ 1970-01-01 00:00:00 +0000: . (added by debugdrawdag)
o 112478962961 B
│ 1970-01-01 00:00:00 +0000: B (added by debugdrawdag)
│ 1970-01-01 00:00:00 +0000: . (removed by debugdrawdag)
o 426bada5c675 A
1970-01-01 00:00:00 +0000: foo (removed by bookmark foo)
1970-01-01 00:00:00 +0000: foo (added by bookmark foo)
1970-01-01 00:00:00 +0000: . (removed by debugdrawdag)"""
sh % "hg debugmetalogroots -v" == r"""
14 1970-01-01 00:00:00 +0000 e101d079054ded8fb61926aa99c6abb5162925f5 metaedit -mE1 Transaction: metaedit
13 1970-01-01 00:00:00 +0000 ff82865a3d1b68db09dd5bdf19a14b0d9af724b0 debugdrawdag Transaction: bookmark
12 1970-01-01 00:00:00 +0000 ce551e7adf176b648a9fca3ff1dfd0d168e9b9ab debugdrawdag Transaction: commit
11 1970-01-01 00:00:00 +0000 6526ac5762293b2f27d3d367492ec2f7941b8250 debugdrawdag Transaction: bookmark
10 1970-01-01 00:00:00 +0000 590432f4f161f2ab0b5cf78fd64c9aee54572c51 debugdrawdag Transaction: commit
9 1970-01-01 00:00:00 +0000 64ba23c13141797476fbf8dda015c9a733b25d1f bookmark foo Transaction: bookmark
8 1970-01-01 00:00:00 +0000 280022070a10d2a1a752f6e0951c7649fa3aeed0 bookmark foo Transaction: bookmark
7 1970-01-01 00:00:00 +0000 2b568bbe60079854ed4204d6c23632ec148ba374 debugdrawdag Transaction: bookmark
6 1970-01-01 00:00:00 +0000 6002154bee3bcd116f66ce7e8a39a17863d30bf4 debugdrawdag Transaction: commit
5 1970-01-01 00:00:00 +0000 8cbb80514b72ecf0e96d4aac3bd6138179acaa8e debugdrawdag Transaction: bookmark
4 1970-01-01 00:00:00 +0000 c7b19359bc92edd4ff376128f551fa47d2167a22 debugdrawdag Transaction: commit
3 1970-01-01 00:00:00 +0000 c94b525421a275f3af67c8780587af81b2eac8ae debugdrawdag Transaction: bookmark
2 1970-01-01 00:00:00 +0000 d4275ab8efc006b015186bd434e7935dd7d653f7 debugdrawdag Transaction: commit
1 1970-01-01 00:00:00 +0000 433fb6a14b4e7044062a8886ddcb13ffa34a78c1 migrate from vfs
0 1970-01-01 00:00:00 +0000 29e2dcfbb16f63bb0254df7585a15bb6fb5e927d"""
sh % "hg up -q null"
sh % "HGFORCEMETALOGROOT=280022070a10d2a1a752f6e0951c7649fa3aeed0 hg log -G -r 'all()' -T '{desc} {bookmarks}'" == r"""
o C C
o B B
o A A foo
hint[metalog-root-override]: MetaLog root was overridden to 280022070a10d2a1a752f6e0951c7649fa3aeed0 by an environment variable. This should only be used for debugging.
hint[hint-ack]: use 'hg hint --ack metalog-root-override' to silence these hints"""