1

I'm searching through a particularly gnarly set of older revisions in one of our repositories, trying to figure out what happened with a couple of supposed merges.

When I look at one of the revisions in the target branch, it shows me content that's exactly the same as a revision on the source branch (trust me, I checked the diffs, too):

$ svn --log --verbose --use-merge-history --revision 100 ^/target
------------------------------------------------------------------------
r100 | <author> | <date> | 1 line
Changed paths:
   A /path/to/new/file
------------------------------------------------------------------------

But, there's something missing. There's no mergeinfo property change recorded anywhere, right? So it can't be a merge, as best I understand it. Maybe the author hand edited the file?

I double checked what Subversion thought were eligible revisions:

$ svn mergeinfo --show-revs eligible ^/source ^/target | grep 100

Nothing! Subversion thinks the revision has been merged despite the lack of mergeinfo.

$ svn mergeinfo --show-revs merged ^/source ^/target | grep 100
r100

Is that possible? How?


I read the CollabNet article and the Svn Book section on missing mergeinfo.

  • Merging unrelated sources: This is not the case, as I said, I can see the exact content/diff in the source branch.
  • Merging from foreign repositories: Ditto.
  • Using --ignore-ancestry: This is possible (I don't know what command the author invoked), but wouldn't this revision appear in the merge-eligible list?
  • Applying reverse merges from a target's natural history: It's obvious from history that this is not a reverse merge.
Anthony Mastrean
  • 21,850
  • 21
  • 110
  • 188

1 Answers1

2

Oops, there actually is svn:mergeinfo property as far as I can tell now. I don't remember whether svn log prints property-only changes (it has to), try running svn log --verbose or run svn propget svn:mergeinfo --verbose against the ^/target.


Read SVNBook | Merges Without Mergeinfo.

BTW, don't forget that mergeinfo was introduced in Subversion 1.5. So if the merge happened with older Subversion version, there is a chance that this is why svn:mergeinfo property is missing.

And yes, the commit author out of ignorance could hand edit the file to make the commit look like a merge.

bahrep
  • 29,961
  • 12
  • 103
  • 150
  • I updated my question. It's possible that it's the ignore ancestry option, but wouldn't that leave the source revision in the merge-eligible list? – Anthony Mastrean Jun 06 '16 at 19:01
  • My original log statement was verbose. I guess it's *possible* that someone modified the property as part of another revision? – Anthony Mastrean Jun 06 '16 at 20:17
  • @AnthonyMastrean yep, one can remove the property, but the property is versioned and you should be able to find the revision that adjusted or removed it. --show-revs shows that r100 was merged, mergeinfo has to be in place. Check the root directories. – bahrep Jun 06 '16 at 20:21
  • In this case, I suspect someone *added* the revision to the mergeinfo property. Again, there's no mergeinfo recorded on the revision in question, but `mergeinfo --show-revs merged` shows the revision. – Anthony Mastrean Jun 06 '16 at 20:23
  • There doesn't seem to be a method for listing/querying property history, though. – Anthony Mastrean Jun 06 '16 at 20:25
  • @AnthonyMastrean Just to make sure we are on the same page: Mergeinfo property should be placed on the path that represents the branch or trunk root. – bahrep Jun 06 '16 at 20:26
  • @AnthonyMastrean to me it just looks like some misunderstanding how properties and mergeinfo work in svn. Btw, you can view changes made to props only using svn diff --properties-only http://svnbook.red-bean.com/en/1.8/svn.ref.svn.html#svn.ref.svn.sw.properties_only – bahrep Jun 06 '16 at 20:32