mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 01:39:21 +03:00
1d7668ffba
Summary: As we discussed before, let's add get_name() method that returns MPathElement, and remove get_path() and get_mpath(). Except for renaming, diff also make repoconfig work with tree manifest, and fixes linknodes creation in blobimport - previously basename was used instead of the whole path. Reviewed By: jsgf Differential Revision: D6857097 fbshipit-source-id: c09f3ff40d38643bd44aee8b4488277d658cf4f6
73 lines
1.4 KiB
Bash
73 lines
1.4 KiB
Bash
#!/bin/bash
|
|
# Library routines and initial setup for Mononoke-related tests.
|
|
|
|
function mononoke {
|
|
$MONONOKE_SERVER "$@" >> "$TESTTMP/mononoke.out" 2>&1 &
|
|
echo $! >> "$DAEMON_PIDS"
|
|
}
|
|
|
|
# Wait until a Mononoke server is available for this repo.
|
|
function wait_for_mononoke {
|
|
local socket="$1/.hg/mononoke.sock"
|
|
local attempts=50
|
|
until [[ -S $socket || $attempts -le 0 ]]; do
|
|
attempts=$((attempts - 1))
|
|
sleep 0.1
|
|
done
|
|
}
|
|
|
|
function setup_config_repo {
|
|
hg init mononoke-config
|
|
cd mononoke-config || exit
|
|
cat >> .hg/hgrc <<EOF
|
|
[extensions]
|
|
treemanifest=
|
|
remotefilelog=
|
|
[treemanifest]
|
|
server=True
|
|
[remotefilelog]
|
|
server=True
|
|
shallowtrees=True
|
|
EOF
|
|
|
|
mkdir repos
|
|
cat > repos/repo <<CONFIG
|
|
path="$TESTTMP/repo"
|
|
repotype="blob:files"
|
|
CONFIG
|
|
hg add -q repos
|
|
hg ci -ma
|
|
hg bookmark test-config
|
|
hg backfilltree
|
|
cd ..
|
|
}
|
|
function blobimport {
|
|
$MONONOKE_BLOBIMPORT "$@"
|
|
}
|
|
|
|
function edenserver {
|
|
$MONONOKE_EDEN_SERVER "$@" >> "$TESTTMP/edenserver.out" 2>&1 &
|
|
echo $! >> "$DAEMON_PIDS"
|
|
}
|
|
|
|
# Run an hg binary configured with the settings required to talk to Mononoke.
|
|
function hgmn {
|
|
hg --config ui.ssh="$DUMMYSSH" --config ui.remotecmd="$MONONOKE_HGCLI" "$@"
|
|
}
|
|
|
|
hgcloneshallow() {
|
|
local dest
|
|
orig=$1
|
|
shift
|
|
dest=$1
|
|
shift
|
|
hg clone --shallow --config remotefilelog.reponame=master "$orig" "$dest" "$@"
|
|
cat >> "$dest"/.hg/hgrc <<EOF
|
|
[remotefilelog]
|
|
reponame=master
|
|
datapackversion=1
|
|
[phases]
|
|
publish=False
|
|
EOF
|
|
}
|