Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Find revision in trunk that a branch was created from

I am trying to merge the latest changes from trunk into a branch of my project, but the problem is I don't know what revision of the trunk I checked out that I eventually created the branch from. I would think SVN logged this somewhere. Does anyone know how I can find the revision number?

(In other words, the Subversion equivalent of git merge-base master branch-name)

like image 259
Andy Avatar asked Jun 06 '11 21:06

Andy


People also ask

How to check when a branch was created in svn?

Run svn log -v svn://svn/branches/super_foo , it will tell you something like this - /branches/super_foo from /trunk/foo:22890 , which means that you have copied revision 22890 of trunk into your branch. Show activity on this post. For the Cornerstone app, to see where a tag or branch originated, look in the timeline.


2 Answers

From the command line, the --stop-on-copy flag can be used to help show you where you copied a branch from:

svn log --stop-on-copy --verbose --limit 1 -r0:HEAD ^/branches/feature 

(where feature is the name of your branch)

The last line of will say something like this:

Changed paths:    A /branches/feature (from /trunk:1234) 
like image 189
richq Avatar answered Sep 20 '22 19:09

richq


Perhaps a little bit late but.

If you're currently in the branch you can run:

svn log -r 1:HEAD --limit 1 --stop-on-copy 

It displays the first revision of the branch i.e. when you created it.

like image 33
perkrlsn Avatar answered Sep 18 '22 19:09

perkrlsn