Import patchsync version 2.3
authorMatt McCutchen <matt@mattmccutchen.net>
Wed, 2 Sep 2020 20:42:51 +0000 (16:42 -0400)
committerMatt McCutchen <matt@mattmccutchen.net>
Wed, 2 Sep 2020 20:42:51 +0000 (16:42 -0400)
Modification time: 2007-01-07 12:00:43 -0500

patchsync

index 31dd624..e63d6da 100755 (executable)
--- 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.
 # -- 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]
 #
 
 # usage: patchsync [--dry-run] <staging> [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 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 ]
 
 function exitoneok {
        "$@" || [ $? == 1 ]
@@ -153,7 +153,7 @@ fi
 cd "$staging" || { echo "Failed to enter staging dir!" 1>&2; exit 1; }
 shift
 
 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; }
 
 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
        
                exit 1
        fi
        
-       # Set up arguments.  Open templates because we will change directories.
+       # Set up arguments.
        trunk="$1"
        patch="$2"
        branch="$3"
        staging="$4"
        
        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; }
        
        ! [ -e "$staging" ] || { echo "Staging dir already exists!" 1>&2; exit 1; }
        [ -d "$trunk" ] || { echo "Trunk does not exist!" 1>&2; exit 1; }