From: Matt McCutchen Date: Wed, 2 Sep 2020 20:42:51 +0000 (-0400) Subject: Import patchsync version 2.3 X-Git-Url: https://mattmccutchen.net/utils/utils.git/commitdiff_plain/75ae3f77056cd1dca3424b9eae8391092bed4fd0?hp=5b69859a5224244f3b1d2721d1545f0aca7ee2cc Import patchsync version 2.3 Modification time: 2007-01-07 12:00:43 -0500 --- diff --git a/patchsync b/patchsync index 31dd624..e63d6da 100755 --- a/patchsync +++ b/patchsync @@ -4,7 +4,7 @@ # -- 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] [branch | patch] # @@ -92,7 +92,7 @@ set -o pipefail 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 ] @@ -153,7 +153,7 @@ fi 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; } @@ -350,13 +350,13 @@ function patchsync_new { 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; }