From f933310663ddc4569a66e355536c5422e8aa1f20 Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Mon, 2 Apr 2012 13:40:23 -0400 Subject: [PATCH] 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. --- scripts/rev_control/svnapply.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 scripts/rev_control/svnapply.sh 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 "$@" '{}' + -- 2.34.1