#!/bin/bash # Library routines and initial setup for Mononoke-related tests. function mononoke { $MONONOKE_SERVER "$@" --debug >> "$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_common_config { setup_config_repo cat >> "$HGRCPATH" <> .hg/hgrc < repos/repo <> "$TESTTMP/blobimport.out" 2>&1 reponame=$_ mkdir -p "$reponame"/.hg mkdir -p "$reponame"/books } 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 paths.default=ssh://user@dummy/repo --config ui.remotecmd="$MONONOKE_HGCLI" "$@" } function hgmn_show { echo "LOG $*" hgmn log --template 'node:\t{node}\np1node:\t{p1node}\np2node:\t{p2node}\nauthor:\t{author}\ndate:\t{date}\ndesc:\t{desc}\n\n{diff()}' -r "$@" hgmn update "$@" echo echo "CONTENT $*" find . -type f -not -path "./.hg/*" -print -exec cat {} \; } function hginit_treemanifest() { hg init "$@" cat >> "$1"/.hg/hgrc <> "$2"/.hg/hgrc <> .hg/hgrc <> .hg/hgrc <