tests: set default configuration for newserver and clones

Summary:
When using the new server and client helpers, let's set some default
configuration that is expected in production. This will allow us to
mostly-transparently swap out the server with Mononoke for any test who uses
these helpers.

Reviewed By: quark-zju

Differential Revision: D15381856

fbshipit-source-id: 054fcc2768eba38e704e713aeb1bc8e84faa2be1
This commit is contained in:
Durham Goode 2019-05-28 03:12:27 -07:00 committed by Facebook Github Bot
parent 03f1bea99a
commit 2e5e174b8d
2 changed files with 25 additions and 16 deletions

View File

@ -13,11 +13,6 @@
Shallow clone from full
$ clone master shallow --noupdate
streaming all changes
2 files to transfer, 472 bytes of data
transferred 472 bytes in * seconds (*/sec) (glob)
searching for changes
no changes found
$ cd shallow
$ cat .hg/requires
dotencode
@ -29,7 +24,7 @@ Shallow clone from full
treestate
$ hg update
fetching tree '' 479230b8a7bab24c6717f4997ec84092d304b5dd, found via 2e73264fab97
fetching tree '' 05bd2758dd7a25912490d0633b8975bf52bfab06, found via 79c51fb96423
2 trees fetched over 0.00s
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
2 files fetched over 1 fetches - (2 misses, 0.00% hit ratio) over *s (glob)
@ -37,8 +32,7 @@ Shallow clone from full
Log on a file without -f
$ hg log dir/y
warning: file log can be slow on large repos - use -f to speed it up
changeset: 1:2e73264fab97
changeset: 1:79c51fb96423
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
@ -47,7 +41,7 @@ Log on a file without -f
Log on a file with -f
$ hg log -f dir/y
changeset: 1:2e73264fab97
changeset: 1:79c51fb96423
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
@ -55,7 +49,7 @@ Log on a file with -f
Log on a file with kind in path
$ hg log -r "filelog('path:dir/y')"
changeset: 1:2e73264fab97
changeset: 1:79c51fb96423
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
@ -64,7 +58,7 @@ Log on a file with kind in path
Log on multiple files with -f
$ hg log -f dir/y x
changeset: 1:2e73264fab97
changeset: 1:79c51fb96423
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
@ -78,7 +72,7 @@ Log on multiple files with -f
Log on a directory
$ hg log dir
changeset: 1:2e73264fab97
changeset: 1:79c51fb96423
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000
@ -88,8 +82,7 @@ Log on a file from inside a directory
$ cd dir
$ hg log y
warning: file log can be slow on large repos - use -f to speed it up
changeset: 1:2e73264fab97
changeset: 1:79c51fb96423
tag: tip
user: test
date: Thu Jan 01 00:00:00 1970 +0000

View File

@ -22,7 +22,9 @@ newserver() {
cat >> "$reponame/.hg/hgrc" <<EOF
[extensions]
lz4revlog=
remotefilelog=
remotenames=
treemanifest=
[remotefilelog]
@ -30,6 +32,7 @@ reponame=$reponame
server=True
[treemanifest]
flatcompat=False
server=True
treeonly=True
EOF
@ -40,16 +43,24 @@ clone() {
clientname="$2"
shift 2
cd "$TESTTMP"
hg clone --shallow "ssh://user@dummy/$servername" "$clientname" "$@" \
remotecmd="hg"
hg clone -q --shallow "ssh://user@dummy/$servername" "$clientname" "$@" \
--config "extensions.lz4revlog=" \
--config "extensions.remotefilelog=" \
--config "extensions.remotenames=" \
--config "extensions.treemanifest=" \
--config "remotefilelog.reponame=$servername" \
--config "treemanifest.treeonly=True"
--config "treemanifest.treeonly=True" \
--config "ui.ssh=$TESTDIR/dummyssh" \
--config "ui.remotecmd=$remotecmd"
cat >> $clientname/.hg/hgrc <<EOF
[extensions]
lz4revlog=
remotefilelog=
remotenames=
treemanifest=
tweakdefaults=
[phases]
publish=False
@ -58,7 +69,12 @@ publish=False
reponame=$servername
[treemanifest]
flatcompat=False
sendtrees=True
treeonly=True
[ui]
ssh=$TESTDIR/dummyssh
EOF
}