-
Notifications
You must be signed in to change notification settings - Fork 4
/
svnclean
executable file
·29 lines (26 loc) · 985 Bytes
/
svnclean
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#!/usr/bin/env bash
#=======================================================================
# svnclean
# File ID: 0f6706d6-f744-11dd-a790-000475e441b9
# Clean up a subversion working copy
# License: GNU General Public License version 2 or later.
#=======================================================================
if [ ! -d .svn/. ]; then
echo "Current directory is not a svn working copy, aborting." >&2
exit 1
fi
echo Warning, this command will delete all files which is not versioned with >&2
echo Subversion. The working copy will be reset. >&2
echo -n "Press 'y' + Enter to continue..." >&2
read choice
if [ "$choice" = "y" ]; then
echo ==== svn cleanup...
svn cleanup .
echo ==== svn revert...
svn revert -R .
# echo ==== Remove unknown files...
# svn stat --no-ignore | grep -E '^[\?I]' | cut -c 9- | \
# perl -pe 's/^/\.\//' | tr '\n' '\0' | xargs -0 -r rm -rfv
echo ==== svn stat --no-ignore...
svn stat --no-ignore
fi