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:

CODE:
  1. svn log -v --stop-on-copy \
  2.     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 Responses to “Subversion: Finding the “base” revision of a branch”

  1. February 4th, 2009 | 21:04

    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. February 4th, 2009 | 21:40

    @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. Boaz
    February 5th, 2009 | 07:59

    Shahar:
    :-D (naughty you... and I was sure you love people as they are... ;-)

  4. Viren
    April 24th, 2009 | 19:43

    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