tags:

views:

130

answers:

1

When I create a branch off a revision of TRUNK, my resulting branch doesn't have any mergeinfo set so as far as I can tell it's impossible to figure out what revision the branch came from later.

I have some scripts that are supposed to automatically generate diffs against TRUNK later, but I don't have the revision numbers I need. If I merge with main again I'll get merginfo set so the scripts can pull it out.

Also I can do

svn merge --record-only svn+ssh://{url}/main@{revision}

This will set the revision. But it's slow and requires checking out the source and committing the change back.

I could also change the scripts to generate a diff just from the changes in the branch, unless there is mergeinfo, then fallback to diffing against trunk, but the special cases are making this awfully complicated.

Is there an easier way ?

Clarification: After doing more subversion research, I read this. What I need is a programmatic way to access the IMPLICIT mergeinfo because when you create a branch via copy, you don't get the explicit mergeinfo property.

The implicit property is effectively /TRUNK:1-BRANCHPOINT indicating the branch has all revisions up to BRANCHPOINT included. What I'm trying to find is that BRANCHPOINT after the branch has been made.

+1  A: 

From the question, I'm not entire sure exactly which diffs you're trying to generate. However, you can always get the revision that a branch came from by using:

svn log -v --stop-on-copy -r 1:HEAD -l 1 svn+ssh://{url}/branch

This orders the revisions oldest first, doesn't go back beyond the copy operation for that branch, and limits it to the 1 revision (the copy operation itself).

However, svn mergeinfo takes account of branch operations and considers them already merged (I think there was a time when it didn't do this, which was annoying, but it's been fixed a while), so using mergeinfo to see what nees to be merged in either direction will show you something sensible.

Jim T
Well I guess I can parse the output from svn log -v to get the revision it came from, but that's far from ideal. I'm adding some clarifications and leaving this open for now.
rhettg