#!/bin/sh -e if [ $# -lt 2 ] || [ $# -gt 3 ]; then cat >&2 <&1) st=$? if [ $st -ne 0 ]; then echo "$output" >&2 echo "Command $@ returned exit status $st." >&2 exit 1 fi ) HG() { "${HG:-hg}" --repository "$source_repo" "$@" } # If upgrading to "current revision", warn if working directory is dirty. if [ ! "$to_rev" ] && [ "$(HG status -mard)" ]; then announce "Warning: Uncommitted changes in working directory will be ignored!" fi from_rev_hash=$(HG id --id --rev "${from_rev:-.}") to_rev_hash=$(HG id --id --rev "${to_rev:-.}") temp=$(readlink -f "$(mktemp --tmpdir -d 'dbmigrate-test.XXXXXX')") cat <