views:

2092

answers:

21

What is your favorite non obvious feature of svn?

+5  A: 

svn log -r BASE:HEAD (possibly with a v option)

Shows what's happened between your version and the head version. Usually tells you who broke the build as well.

krosenvold
+3  A: 

In newer versions: interactive conflict resolution. This way, conflicts don't need to be resolved manually (in most cases, it's very trivial to do this, it's just annoying if it has to be done for a large batch of files). But really, conflict handling in general (i.e. that it blocks you from committing conflicting files).

Konrad Rudolph
+12  A: 

Getting the history of a branch from the branching point:

svn log --stop-on-copy
JesperE
+3  A: 

Performing a rollback by merging the former revision w/ HEAD.

André
+4  A: 

The subversion api and libraries. You can use a central SVN repository even if you prefer to work with a distributed VCS - either using the "svn native" SVK or for example Mercurial (via a bridge). Good apis also mean better tools are possible - they can work with SVN directly, instead of using the commandline client and trying to parse the results.

Kim Sullivan
+24  A: 

Hook scripts (start-commit, pre-commit, post-commit) are great tools for a build system relying on SVN.

Another one which is probably too "obvious", is calling 'svn export' from a build script. It's a really nice way to deploy files to some target directory (a website for example), because you get a clean copy without .svn hidden files. It's far better than updating a remote "deployment" working copy.

Franck
A remote working copy is faster though.
rix0rrr
rix0rr: the company I work for has a script that checks the files that changed with each commit and exports only those. This is even faster than doing svn update.
notJim
+9  A: 

The Subversion api and the client bindings that are built on top of that.

Most SCM systems are a combination of tools that allow calling them via a commandline, but subversion is designed as a stable API to be used by multiple clients. It just provides a commandline client on top of that.

TortoiseSVN, AnkhSVN, SharpSvn, and dozens of other applications and libraries[1] wouldn't be there without subversion being an api.

(I'm glad some of the other/new SCM implementations are starting to realize that a commandline client is not enough to be successfull)

[1] The link page is now offline, but you can still see the old version on http://svn.apache.org/repos/asf/subversion/branches/1.6.x/www/links.html

Bert Huijben
Yeah, this is a huge problem with Git. AFAIK, Ruby's Git bindings simply wrap the command line. It was a real stumbling block when trying to write a Git backend for RabbitVCS.
detly
+2  A: 

And a second answer:

svn status --depth files <path>

This depth support introduced in 1.5 makes Subversion so much faster than before from other tools.

Bert Huijben
+20  A: 
svn log --xml

Having the logs outputted in xml makes them very easy to parse and analyze.

Davide Gualano
+18  A: 

externals.

The wonderful ability to pull 3rd party libraries into your code base and keep them up to date.

I love externals. Still kind of a pain in Mercurial. :-(
SealedSun
+4  A: 

svn diff, even when you're offline and might think diff:ing is not possible.

unwind
The wonders of the pristine copy :) Keep in mind that without network access you can only diff from your working copy BASE revision.
Davide Gualano
+5  A: 

To back out a changeset from your working copy (eg. 4321):

svn merge -c -4321 .
svn checkin

Or multiple changesets:

svn merge -c -4321,-5432 .
Kim Rutherford
+5  A: 

"svn:ignore" property

quant_dev
+7  A: 

My favorite nonobvious feature of svn is how it litters all of my source directories with .svn metadata subdirectories. ;)

cpeterso
No kidding. git FTW.
Andrew Vit
Will be fixed in svn 1.7
Wim Coenen
+16  A: 

svn blame of course. Got to know whose fault it is.

theschmitzer
I would say annotate (aka blame, praise) *is* quite obvious.
Jonik
This is the #1 convincing argument to dump VSS.
Pavel Radzivilovsky
I continue to run into devs which do not know about it...
theschmitzer
My project manager (a former manager at Sun) just found out about this feature this week.
phasetwenty
+2  A: 

came across while searching for something . . here's a favorite non ovbious one from my side .. you can copy paste the "svn working copy" to any other machine or any other OS, its works as if it was checked out there. This works even if it was checked out by a different user !!

Ess
+1  A: 

The option to configure an slave repository to mirror the main one. So a remote group can make all their reads from a local copy. It really accelerates the development.

neves
+14  A: 

Added in svn 1.6: The caret ^ shorthand notation to shorten subversion URLs when using the command line. The caret symbol can be used in place of the portion of the URL up through the repository name.

Ex:

svn switch ^/myProject/branches/fooBranch

instead of

svn switch http://machine22/repos/SandboxRepo/myProject/branches/fooBranch
Scott Bale
cool didn't know of this feature
Brian R. Bondy
Looks like it was introduced in svn 1.6. (Works with my 1.4 repo as long as my client is 1.6.)
Scott Bale
A: 

svn cleanup

When that also says "Run svn cleanup to clean"

find . |grep \\.svn/lock |xargs rm

shakthi
+1  A: 

Cross-platform support for Unicode filenames

I'm working in a Japanese company, so Subversion's Unicode filename support is great. I've been disappointed to see how poorly Unicode filenames are handled by git and Mercurial in comparison (particularly under Windows).

(I also appreciate how well Subversion handles Unicode in log messages etc.)

Craig McQueen
A: 

Uninstall - so I can go back to using Vault, where my modification dates are maintained, I can see who is editing other files in my project, and I rarely have to waste time merging. :P

Webveloper