mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 17:58:27 +03:00
0bb5d9ad67
Summary: On Windows, all the tests that are expecting to find some files in $CACHEDIR would fail due to the directory not existing. Interestingly enough, printing $CACHEDIR would print a reasonable path, which is the same as $TESTTMP. Trying to understand this better, I passed --keep-tmpdir to run-tests and realized that the "real" $TESTTMP was somewhere in my home directory, while the real $CACHEDIR was in fact C:\tmp. I haven't fully understood why, but it looks like $PWD is expanded in C:\tmp, while $TESTTMP is expanded into something else. Reviewed By: quark-zju Differential Revision: D15041274 fbshipit-source-id: 0d167183d74df5f6ab84360c5699e96808fceb9b
95 lines
1.5 KiB
Bash
95 lines
1.5 KiB
Bash
CACHEDIR=$TESTTMP/hgcache
|
|
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
|
|
hg init $name $@ --config remotefilelog.reponame=master
|
|
}
|
|
|
|
clearcache() {
|
|
rm -rf $CACHEDIR/*
|
|
}
|
|
|
|
mkcommit() {
|
|
echo "$1" > "$1"
|
|
hg add "$1"
|
|
hg ci -m "$1"
|
|
}
|
|
|
|
ls_l() {
|
|
$PYTHON $TESTDIR/ls-l.py "$@"
|
|
}
|
|
|
|
findfilessorted() {
|
|
find $1 -type f | sort
|
|
}
|
|
|
|
getmysqldb() {
|
|
source "$TESTDIR/hgsql/library.sh"
|
|
}
|
|
|
|
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
|
|
}
|