Last active
March 13, 2018 10:20
-
-
Save nestserau/ab7d48e857811e1ef808 to your computer and use it in GitHub Desktop.
Subversion script to add all unadded and remove all unremoved files.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
usage() | |
{ | |
printf "Supported commands:\n\tadd - adds all new files\n\tremove - removes all deleted files\n\tdiff - colorized diff\n" | |
exit 1 | |
} | |
if [ "$#" -eq "0" ]; then usage; fi | |
if [ $1 == "add" ]; then | |
svn st | grep ^? | sed 's/^\? *//' | xargs -I% svn add %@ | |
elif [ $1 == "remove" ]; then | |
svn st | grep ^! | sed 's/\! *//' | xargs -I% svn rm %@ | |
elif [ $1 == "diff" ]; then | |
svn diff | colordiff | |
else | |
usage | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
svn add %@
command allows to have at-signs in the path (which otherwise are treated as a peg revision).