Subversion: Finding the “base” revision of a branch

I use Subversion a lot – but today I’ve learned something new:

You can easily find the “base” revision of a branch or a tag (i.e. the revision in which the branch or tag was created) by issuing the following command:

svn log -v --stop-on-copy 

http://glista.googlecode.com/svn/branches/feature-reminders

The last revision you see in the log (in this case from one of my own Glista project’s branches) is the revision the svn copy command was issued on, i.e. the branch was made.

This can then be used when merging the same branch back into trunk.

Neat!

4 thoughts on “Subversion: Finding the “base” revision of a branch

  1. Yeah, its a neat feature of svn log.
    Its a good place to mention “svn red book” (its how I remember it, but its not red – its just the website domain :-) – a very good book from the authors of subversion themselves.
    In fact, the book contains the tip you just posted. Interestingly, I have an older version of the book in which this issue appears as a tip, while in newer versions its not, just mentioned more in a reference way.

    After all said and done, you know svn is for kids and GIT is the real thing don’t you? ;-)

  2. @boaz: svn might be for kids, but git is for gay developers with a Mac (or Ubuntu). Real men simply edit production code with vi and save.

  3. Hi,

    I am new to subversion and trac..
    I am trying to integrate subversion with trac.. They are installed in Red Hat Linux 4..
    Currently I have to apply some properties to folders individually.. Properties like bugtraq:label and bugtraq:message and all..So whenever I make a new folder, before commiting it I have to apply these properties manually.. Can I write a script (or modify an existing script like the pre-commit hook) on the server and automate this process.. I mean I want these properties to be applied to newly created folders as and when they are committed using tortoise svn..

    Can anyone please help me with this asap..

    Thanks,
    Viren