mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 16:57:49 +03:00
6763341497
Summary: Added all the sql commands for the MySQL remote database, and gathered all the commands in a single function Test Plan: Created a serverrepo, two client ones, did push and pulls between them Reviewers: #sourcecontrol, rmcelroy Reviewed By: rmcelroy Differential Revision: https://phabricator.fb.com/D2661606 Tasks: 8660367 Signature: t1:2661606:1447875185:0e9d3876b2f509028585349a9d05b447876b3da0
23 lines
620 B
Bash
23 lines
620 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]
|
|
xdbhost = $DBHOST
|
|
xdb = $DBNAME
|
|
xdbuser = $DBUSER
|
|
xdbpassword = $DBPASS
|
|
xdbport = $DBPORT
|
|
EOF
|
|
}
|