#!/bin/bash # # svnclean.sh - helper app for cleaning subversion working copies # Copyright (C) 2007 Clifford Wolf # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. if [ $# = 0 ]; then set . fi if [ ! -d "$1/.svn" ]; then echo "" >&2 echo "Usage: $0 [WC-PATH [...]]" >&2 echo "" >&2 echo "Remove all non-repository files." >&2 echo "" >&2 exit 1 fi set -e echo "Removing all locally added files..." svn st --no-ignore "$@" | grep '^[?I]' | cut -c8- | sed 's,^ *,,' | xargs -r -d '\n' rm -vrf echo "READY."