Import patchsync version 2.1
[utils/utils.git] / patchsync
index 07e2f0f..31a4001 100755 (executable)
--- a/patchsync
+++ b/patchsync
@@ -211,6 +211,10 @@ if [ -z "$whichtoupdate" ] && [[ -n $trunkch || -n $branchch || -n $patchch ]];
        #echo "Synchronization will update $whichtoupdate."
 fi
 
        #echo "Synchronization will update $whichtoupdate."
 fi
 
+# Remove old copy-out files to be clean and to make sure we don't
+# mistakenly copy them out this time.
+rm -rf patch-new branch-new
+
 if [ -n "$whichtoupdate" ]; then
 
 # Always show what would happen if patch-new and branch-new were copied out.
 if [ -n "$whichtoupdate" ]; then
 
 # Always show what would happen if patch-new and branch-new were copied out.
@@ -219,9 +223,6 @@ if [ -n "$whichtoupdate" ]; then
 # state if no error.
 error=
 
 # state if no error.
 error=
 
-# Don't let stuff from an old run confuse us.
-rm -rf patch-new branch-new
-
 function prepare_branch {
        echo "Preparing updated branch..."
        # No link-dest because we will modify and then link-dest when copying out
 function prepare_branch {
        echo "Preparing updated branch..."
        # No link-dest because we will modify and then link-dest when copying out