sapling/eden/hg-server/tests/test-fb-hgext-treemanifest-noflat.t
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

73 lines
1.9 KiB
Perl

#chg-compatible
$ configure mutation-norecord
$ . "$TESTDIR/library.sh"
This file tests that normal mercurial operations never read the flat manifests
$ cat >> $TESTTMP/flatcheck.py <<EOF
> from __future__ import print_function
> import sys, traceback
> from edenscm.mercurial import extensions, manifest
> def uisetup(ui):
> extensions.wrapfunction(manifest.manifestrevlog, 'revision', readmf)
> def readmf(orig, self, nodeorrev, **kwargs):
> if nodeorrev != -1:
> print('read flat manifest', file=sys.stderr)
> stack = traceback.extract_stack()
> print(''.join(traceback.format_list(stack[-3:-2])), file=sys.stderr)
> return orig(self, nodeorrev, **kwargs)
> EOF
$ hginit master
$ cd master
$ cat >> .hg/hgrc <<EOF
> [treemanifest]
> server=True
> [remotefilelog]
> server=True
> shallowtrees=True
> EOF
$ cd ..
$ hg clone -q ssh://user@dummy/master client
- Add a bunch of files so the manifest is large enough to use deltas
$ cd master
$ echo a >> a
$ echo a >> b
$ echo a >> c
$ echo a >> d
$ echo a >> e
$ echo a >> f
$ echo a >> g
$ echo a >> h
$ hg commit -Aqm 'add a-f'
$ echo a >> a
$ hg commit -Aqm 'modify a'
$ cd ../client
$ cat >> .hg/hgrc <<EOF
> [extensions]
> flatcheck=$TESTTMP/flatcheck.py
>
> [remotefilelog]
> reponame=master
>
> [treemanifest]
> autocreatetrees=True
> EOF
$ hg pull -q -r 0
$ hg pull -q -r 1
$ hg up 'desc(add)'
fetching tree '' 5ce27016a79d253c34c64aebd35bfb09605ad3ee, found via ce051c95cfb8
1 trees fetched over * (glob)
8 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ echo a >> b && hg commit -Aqm 'modify b'
$ hg rebase -d 77dc854aeab9a59885f87fa57bfeddbb73b23443 -r 'max(desc(modify))'
rebasing 667a26a14261 "modify b"
fetching tree '' 9486c937c5894f8f2adbaa0b589e8df5022217c9, found via 77dc854aeab9
1 trees fetched over * (glob)