X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ian/git?a=blobdiff_plain;f=scripts%2Fcvs-repomove;h=92e1765bc371f56197ae617cbf681ce9f4d563aa;hb=e2ce6698329809a11a59e1c3054acce472e766c4;hp=e7d2e53b5af2830e7f9f3c7e74f5467d78a1369b;hpb=18188d730fc2337a9b2caec8f46a65387c9a05c4;p=chiark-utils.git diff --git a/scripts/cvs-repomove b/scripts/cvs-repomove index e7d2e53..92e1765 100755 --- a/scripts/cvs-repomove +++ b/scripts/cvs-repomove @@ -84,7 +84,7 @@ do_move () { movingto="moving-to-$dsthost:$dstrepotrans" resume="$("$CVS_RSH" "$srchost" bash -ec "' if test -d $srcrepo/$module..$movingto; then - echo \" resuming previous attempt at a move\" + echo >&2 \" resuming previous attempt at a move\" resume=true if test -d $srcrepo/$module; then echo >&2 \"but $srcrepo/$module exists too\" @@ -97,10 +97,10 @@ do_move () { set +e previously=\"$(ls -d -- $srcrepo/$module..moved-to-* 2>/dev/null)\" set -e - if [ \"x$previously\" != x ]; then - echo \" btw, module was once before moved away from here\" - mv -- \"$previously\" \ - \"${previously/..moved-to-/..previously-\$(date +%s)-moved-to-}\" + if [ \"x\$previously\" != x ]; then + echo >&2 \" btw, module was once before moved away from here\" + mv -- \"\$previously\" \ + \"\${previously/..moved-to-/..previously-\$(date +%s)-moved-to-}\" fi echo \$resume '")" @@ -115,11 +115,21 @@ do_move () { fi for f in $module..*; do case \"\$f\" in - *..moved-to-*) echo \" btw, module was previously at destn repo\" ;; + *..moved-to-*) + echo \" btw, module was previously at destn repo\" + mv -- \"\$f\" \ + \"\${f/..moved-to-/..previously-\$(date +%s)-moved-to-}\" + ;; *..previously-*) ;; - *..tmp-*) echo \" nb: possibly-stale temp/partial copy \$f\" ;; - *..\*) ;; - *) echo >&2 \"error: found unexpected subdir \$f\"; exit 8;; + *..tmp-*) + echo \" nb: possibly-stale temp/partial copy \$f\" + ;; + *..\*) + ;; + *) + echo >&2 \"error: found unexpected subdir \$f\" + exit 8 + ;; esac done '" @@ -176,7 +186,7 @@ do_furtle () { remotehost="${goose%%:*}" path="${goose#*:}" check_hostname "$remotehost" - check_remote_path "$remotepath/$module" + check_remote_path "$path/$module" isremote=true compute_fqdn_data "$remotehost" if [ "x$fqdn_data" = "x$our_fqdn_data" -a \