naming fixes, terminal title fixes
[feisty_meow.git] / scripts / rev_control / svnapply.sh
1 #!/bin/bash
2 #
3 # Applies arbitrary commands to any svn status.
4 #
5 # For example, this shows any files that are in the working folder but are not part of the svn repository:
6 #    svnapply \? echo
7 #
8 # This deletes all files that are not checked into svn (escape the ? from the shell):
9 #    svnapply \? rm
10 #
11 # List all conflicted files:
12 #    svnapply C ls -l
13 #
14 # found on web at:
15 # http://stackoverflow.com/questions/160104/how-do-you-add-all-untracked-files-in-svn-something-like-git-add-i
16 #
17
18 source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
19
20 save_terminal_title
21
22 PATTERN="$1"; shift
23
24 svn st | egrep "^\\${PATTERN}[ ]+" | \
25   sed -e "s|^\\${PATTERN}[ ]*||" | \
26   sed -e "s|\\\\|/|g" | \
27   xargs -i "$@" '{}'
28
29 restore_terminal_title
30