2019-04-23 04:35:16 +03:00
|
|
|
CACHEDIR=$TESTTMP/hgcache
|
2020-02-28 04:51:13 +03:00
|
|
|
export DUMMYSSH_STABLE_ORDER=1
|
2018-01-09 05:58:08 +03:00
|
|
|
cat >> $HGRCPATH <<EOF
|
|
|
|
[remotefilelog]
|
|
|
|
cachepath=$CACHEDIR
|
|
|
|
debug=True
|
|
|
|
historypackv1=True
|
|
|
|
[extensions]
|
|
|
|
remotefilelog=
|
|
|
|
rebase=
|
|
|
|
[ui]
|
|
|
|
ssh=python "$TESTDIR/dummyssh"
|
|
|
|
[server]
|
|
|
|
preferuncompressed=True
|
|
|
|
[experimental]
|
|
|
|
changegroup3=True
|
|
|
|
[rebase]
|
|
|
|
singletransaction=True
|
|
|
|
EOF
|
|
|
|
|
|
|
|
hgcloneshallow() {
|
|
|
|
local name
|
|
|
|
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
|
|
|
|
[phases]
|
|
|
|
publish=False
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
hgcloneshallowlfs() {
|
|
|
|
local name
|
|
|
|
local dest
|
|
|
|
local lfsdir
|
|
|
|
orig=$1
|
|
|
|
shift
|
|
|
|
dest=$1
|
|
|
|
shift
|
|
|
|
lfsdir=$1
|
|
|
|
shift
|
|
|
|
hg clone --shallow --config "extensions.lfs=" --config "lfs.url=$lfsdir" --config remotefilelog.reponame=master $orig $dest $@
|
|
|
|
cat >> $dest/.hg/hgrc <<EOF
|
|
|
|
[extensions]
|
|
|
|
lfs=
|
|
|
|
[lfs]
|
|
|
|
url=$lfsdir
|
|
|
|
[remotefilelog]
|
|
|
|
reponame=master
|
|
|
|
[phases]
|
|
|
|
publish=False
|
|
|
|
EOF
|
|
|
|
}
|
|
|
|
|
|
|
|
hginit() {
|
|
|
|
local name
|
|
|
|
name=$1
|
|
|
|
shift
|
2018-02-20 21:34:23 +03:00
|
|
|
hg init $name $@ --config remotefilelog.reponame=master
|
2018-01-09 05:58:08 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
clearcache() {
|
|
|
|
rm -rf $CACHEDIR/*
|
|
|
|
}
|
|
|
|
|
|
|
|
mkcommit() {
|
|
|
|
echo "$1" > "$1"
|
|
|
|
hg add "$1"
|
|
|
|
hg ci -m "$1"
|
|
|
|
}
|
|
|
|
|
|
|
|
ls_l() {
|
|
|
|
$PYTHON $TESTDIR/ls-l.py "$@"
|
|
|
|
}
|
2018-07-13 19:19:17 +03:00
|
|
|
|
2018-08-20 14:21:50 +03:00
|
|
|
findfilessorted() {
|
|
|
|
find $1 -type f | sort
|
|
|
|
}
|
|
|
|
|
2018-07-13 19:19:17 +03:00
|
|
|
getmysqldb() {
|
2018-07-24 04:51:35 +03:00
|
|
|
source "$TESTDIR/hgsql/library.sh"
|
2018-07-13 19:19:17 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
createpushrebaserecordingdb() {
|
|
|
|
mysql -h $DBHOST -P $DBPORT -u $DBUSER $DBPASSOPT -e "CREATE DATABASE IF NOT EXISTS $DBNAME;" 2>/dev/null
|
|
|
|
mysql -h $DBHOST -P $DBPORT -D $DBNAME -u $DBUSER $DBPASSOPT <<EOF
|
|
|
|
DROP TABLE IF EXISTS pushrebaserecording;
|
|
|
|
$(cat $TESTDIR/pushrebase_replay_schema.sql)
|
|
|
|
EOF
|
|
|
|
}
|