Posts tagged Subversion
Subversion – Add / Remove Multiple Files at same Time
0Working within frameworks like Symfony you may find yourself having to add/remove multiple files at a time (adding a new module) to/from a symfony repository. Instead of doing per file, use one of the following commands:
svn remove $(svn status | grep '^\!' | sed 's/^\! *//' | xargs) #remove multiple files svn add $(svn status | grep '^\?' | sed 's/^\? *//' | xargs) #add multiple files
Subversion – Auto Versioning (WebDAV) – Viewing Previous Revisions
0Out of the box, Subversion does not support the ability to view previous revisions via a web browser, however if you enable ‘Auto Versioning’ (aka WebDAV), this feature will be available to you.
For more information on setting up WebDAV for Subversion check out: http://svnbook.red-bean.com/en/1.2/svn.webdav.autoversioning.html
If you do have WebDAV functionality enabled, you can view previous revisions by using the following url construct as a guide:
http://svn.somedomain.com/repos/!svn/bc/14
’14′ in the above example represents revision 14.
Subversion – FSFS vs Berkeley DB
0I was attempting to compile subversion on my shared web hosting server and it finished with the following message:
You don’t seem to have Berkeley DB version 4.0.14 or newer installed and linked to APR-UTIL. We have created Makefiles which will build without the Berkeley DB back-end; your repositories will use FSFS as the default back-end. You can find the latest version of Berkeley DB here: http://www.oracle.com/technology/software/products/berkeley-db/index.html
At first glance this appears to be a bad thing… wtf is FSFS and why is subversion making a big deal about not using Berkeley DB as the backend? After some googling I came across a site outlining the benefits of FSFS over Berkeley DB and found it to be an interesting read, if you get time you should check it out.
Subversion – Basic Usage
0Subversion is an open source version control software app heavily used in the software dev world. I know there are 43 million other sites that have basically the same information, but I tried hard to reduce the amount of fluff and just get down to the nitty gritty.
Initial Import (adding existing code to svn repo)
svn import /path/to/src http://svn.example.com --message="Initial Import"
Diff – Discounting whitespace
svn diff -x -w
Diff – Discounting whitespace – Listing only files that are diff (not the changes)
svn diff -x -w | fgrep +++
Commit (must be in working copy dir)
svn commit -m "Your commit message"
Delete
svn delete http://svn.example.com/file/to/be/deleted
Add
svn add http://fqdn/file/to/be/added
Revert (ALL working copy files)
svn revert -R .
Revert (Single working copy file)
svn revert -R /path/to/file/filename.php
Merge (Dry run)
svn merge --dry-run -r 23:HEAD http://svn.example.com/branches/maint/web
Merge
svn merge -r 23:HEAD http://svn.example.com/branches/maint/web
Move
svn move /path/to/dir/you/want/to/move /path/where/you/want/dir/to/go
Example Usage
#Adds existing code to your subversion repository svn import /path/to/src http://svn.example.com --message="Initial Import" #Checkout code for your dev environment svn checkout http://svn.example.com /path/to/dev/env #Checkout code for your prod environnment svn checkout http://svn.example.com /path/to/prod/env