mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 17:27:53 +03:00
b3ca500f64
Summary: moving remote to a ui config. servers are True, clients are False. Test Plan: the former tests still pass Reviewers: #sourcecontrol, rmcelroy Differential Revision: https://phabricator.fb.com/D2671855 Tasks: 8660367
31 lines
719 B
Bash
31 lines
719 B
Bash
DBHOSTPORT=$($TESTDIR/getdb.sh)
|
|
DBHOST=`echo $DBHOSTPORT | cut -d : -f 1`
|
|
DBPORT=`echo $DBHOSTPORT | cut -d : -f 2`
|
|
DBNAME=`echo $DBHOSTPORT | cut -d : -f 3`
|
|
DBUSER=`echo $DBHOSTPORT | cut -d : -f 4`
|
|
DBPASS=`echo $DBHOSTPORT | cut -d : -f 5-`
|
|
|
|
mysql -h $DBHOST -P $DBPORT -u $DBUSER -p"$DBPASS" -e "
|
|
CREATE DATABASE IF NOT EXISTS $DBNAME;" 2>/dev/null
|
|
mysql -h $DBHOST -P $DBPORT -D $DBNAME -u $DBUSER -p"$DBPASS" -e '
|
|
DROP TABLE IF EXISTS Moves;' 2>/dev/null
|
|
|
|
function initserver() {
|
|
cat >> $1/.hg/hgrc <<EOF
|
|
[copytrace]
|
|
remote = True
|
|
xdbhost = $DBHOST
|
|
xdb = $DBNAME
|
|
xdbuser = $DBUSER
|
|
xdbpassword = $DBPASS
|
|
xdbport = $DBPORT
|
|
EOF
|
|
}
|
|
|
|
function initclient() {
|
|
cat >> $1/.hg/hgrc <<EOF
|
|
[copytrace]
|
|
remote = False
|
|
EOF
|
|
}
|