From: Fred T. Hamster Date: Mon, 2 Apr 2012 17:40:23 +0000 (-0400) Subject: new script for running commands against code in a particular state in svn. X-Git-Tag: 2.140.90~1456 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=f933310663ddc4569a66e355536c5422e8aa1f20;p=feisty_meow.git new script for running commands against code in a particular state in svn. a handy one is: "svnapply.sh \? echo" which shows all the un-checked in files. --- diff --git a/scripts/rev_control/svnapply.sh b/scripts/rev_control/svnapply.sh new file mode 100644 index 00000000..040675ce --- /dev/null +++ b/scripts/rev_control/svnapply.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# +# Applies arbitrary commands to any svn status. e.g. +# +# Delete all non-svn files (escape the ? from the shell): +# svnapply \? rm +# +# List all conflicted files: +# svnapply C ls -l +# +# found on web at: http://stackoverflow.com/questions/160104/how-do-you-add-all-untracked-files-in-svn-something-like-git-add-i +# + +PATTERN="$1"; shift + +svn st | egrep "^\\${PATTERN}[ ]+" | \ + sed -e "s|^\\${PATTERN}[ ]*||" | \ + sed -e "s|\\\\|/|g" | \ + xargs -i "$@" '{}' +