#!/bin/bash
echo "SVN Sync for $(pwd)"
if [ ! -d ".svn" ]; then
echo "No .svn folder found, make sure you are at the root of the svn project"
exit 1
fi
# Add all files not currently under source countrol
if [ $(svn status | grep ^? | wc -l) -ne 0 ]; then
svn status | grep ^? | awk -F " " '{print $2}' | tr "\n" "\0" | xargs -0 svn add
fi
# Delete all files from svn that are not in your local dir
if [ $(svn status | grep ^! | wc -l) -ne 0 ]; then
svn status | grep ^! | awk -F " " '{print $2}' | tr "\n" "\0" | xargs -0 svn delete
fi
if [ $(svn status | wc -l) -eq 0 ]; then
echo "No files modified, nothing to do"
fi
#!/bin/bash
# Fix obstructed versioned items by removing them and re-adding them
# mReschke 2014-04-17
tmp="/tmp/svntemp"
if [ $(svn status | grep ^~ | wc -l) -ne 0 ]; then
if [ -e "$tmp" ]; then
echo "$tmp exists, please remove it first"
exit 1
fi
mkdir -p $tmp
for file in $(svn status | grep ^~ | awk -F " " '{print $2}'); do
# Copy while preserving directory tree
cp -rfv --parents $file $tmp/
# Remove copied files from svn folder
rm -rf $file
done
svn status | grep ^! | awk -F " " '{print $2}' | tr "\n" "\0" | xargs -0 svn delete
svn commit
cp -rfv $tmp/*
svn status | grep ^? | awk -F " " '{print $2}' | tr "\n" "\0" | xargs -0 svn add
svn commit
echo
echo "Once you verify all is good, you can delete $tmp"
else
echo "Nothing to do, no obstructed ~ items"
fi
svn copy http://svn.mreschke.net/mrcore/trunk http://svn.mreschke.net/mrcore/tags/mrcore-4.1.2 -m "Tagged for version 4.1.2 release"