# HG changeset patch # User Pierre-Yves David # Date 1552240342 -3600 # Node ID a60e9f1635954527a8b053bcae95ad1752510fa9 # Parent cb6c9d41a23e641e2a362401677577e9b2f8be51 discovery-helper: bail out if destination already exists diff -r cb6c9d41a23e -r a60e9f163595 contrib/perf-utils/discovery-helper.sh --- 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