# -- Matt McCutchen
# If I had to update the version in the --version message separately, I would forget.
-PATCHSYNC_VERSION=2.2
+PATCHSYNC_VERSION=2.3
# usage: patchsync [--dry-run] <staging> [branch | patch]
#
type rsync >/dev/null 2>&1 || \
{ echo "Patchsync requires rsync, but there's no rsync on your path!" 1>&2; exit 1; }
# If a cp2 is available, use it; otherwise define our own.
-type cp2 >/dev/null 2>&1 || function cp2 { rsync -rltE --chmod=ugo=rwx "$@"; }
+type cp2 >/dev/null 2>&1 || function cp2 { exec rsync -rltE --chmod=ugo=rwx "$@"; }
function exitoneok {
"$@" || [ $? == 1 ]
cd "$staging" || { echo "Failed to enter staging dir!" 1>&2; exit 1; }
shift
-. settings
+. ./settings
type do_diff >/dev/null 2>&1 || { echo "do_diff is not defined!" 1>&2; exit 1; }
type do_patch >/dev/null 2>&1 || { echo "do_patch is not defined!" 1>&2; exit 1; }
exit 1
fi
- # Set up arguments. Open templates because we will change directories.
+ # Set up arguments.
trunk="$1"
patch="$2"
branch="$3"
staging="$4"
- # What exists? Whichtochange first?
+ # What exists?
! [ -e "$staging" ] || { echo "Staging dir already exists!" 1>&2; exit 1; }
[ -d "$trunk" ] || { echo "Trunk does not exist!" 1>&2; exit 1; }