c9db62e71cce74b3756b570637faa8279d42cd88
[feisty_meow.git] / scripts / rev_control / svnapply.sh
1 #!/bin/bash
2 #
3 # Applies arbitrary commands to any svn status. e.g.
4 #
5 # Delete all non-svn files (escape the ? from the shell):
6 # svnapply \? rm
7 #
8 # List all conflicted files:
9 # svnapply C ls -l
10 #
11 # found on web at:
12 # http://stackoverflow.com/questions/160104/how-do-you-add-all-untracked-files-in-svn-something-like-git-add-i
13 #
14
15 PATTERN="$1"; shift
16
17 svn st | egrep "^\\${PATTERN}[ ]+" | \
18   sed -e "s|^\\${PATTERN}[ ]*||" | \
19   sed -e "s|\\\\|/|g" | \
20   xargs -i "$@" '{}'
21