--- a/contrib/perf-utils/discovery-helper.sh Sun Mar 10 18:50:38 2019 +0100
+++ b/contrib/perf-utils/discovery-helper.sh Sun Mar 10 18:52:22 2019 +0100
@@ -82,10 +82,14 @@
fi
buildone() {
- side=$1
- dest=$2
- revset=$3
+ side="$1"
+ dest="$2"
+ revset="$3"
echo "### building $side repository: $dest"
+ if [ -e "$dest" ]; then
+ echo "destination repo already exists: $dest" >&2
+ exit 1
+ fi
echo '# cloning'
hg clone --noupdate "${repo}" "${dest}"
echo '# stripping' '"'${revset}'"'
@@ -93,9 +97,9 @@
}
if [ $doleft -eq 1 ]; then
- buildone left $leftrepo $leftsubset
+ buildone left "$leftrepo" "$leftsubset"
fi
if [ $doright -eq 1 ]; then
- buildone right $rightrepo $rightsubset
+ buildone right "$rightrepo" "$rightsubset"
fi