Native commands
- Revert current local folder to revision 666:
svn merge -rHEAD:666 ./
- Create an empty repository:
svnadmin create ./my-repo
- Dump a repository (a sure way to migrate a subversion repository from one version to another):
svnadmin dump ./my-repo > ./my-repo.dmp
- Migrate a remote Subversion repository without creating an intermediate dump file:
ssh -C user@myserver.com "svnadmin dump /home/user/my-repo" | svnadmin load /home/user2/my-new-repo
- Launch a standalone Subversion server listening on port 3690 and serving all repositories located in
./repos/:svnserve --daemon --listen-port 3690 --root ./repos/
Local working copy hacking
- Recursive and case insensitive content search on non-binary files from the current folder, while ignoring
.svnfolders and their content:find ./ -type f -not -regex ".*\/.svn\/.*" -exec grep -Iil "string to search" {} \; - Same thing as above but with an alternative approach (that don’t work with large folder content):
grep -Ii "string to search" $(find . | grep -v .svn)
Other alternative: use ack.
- Use
sedto replace text in all files except in subversion metadatas:find ./ -type f -not -regex ".*\/.svn\/.*" -print -exec sed -i 's/str1/str2/g' "{}" \; - Use
svn deleteto remove all files containing a tilde in their name without touching local subversion metadatas:find -type f -not -regex ".*\/.svn\/.*" -name "*˜*" -print -exec svn delete "{}" \; - In a repository structure containing sub-projects (thinks of Plone’s collective repository as an example), get the list of all folders in all trunks, while ignoring subversion metadata folders:
find ./ -type d -regex ".*\/trunk\/?.*" -not -regex ".*\/.svn\/?.*" -print
- Similarly to the command above, replace all occurrences of the string
@coolcavemen.frby@coolcavemen.comin alltrunksubfolders while ignoring.svncontent:find ./ -type f -regex ".*\/trunk\/.*" -not -regex ".*\/.svn\/.*" -print -exec sed -i 's/@coolcavemen\.fr/@coolcavemen\.com/g' "{}" \; - Set a svn property to ignore all
.mofiles during commit in every folder of our local working copy containing.pofiles:find ./ -type f -name "*.po" -regex ".*\/trunk\/.*" -not -regex ".*\/.svn\/.*" -printf "%h\n" | uniq | xargs svn propset "svn:ignore" "*.mo"
