How to identify which target revision was created by a merge operation?

lumar
lumar
When I retrieve (using [B]svnlook pg[/B]) the [B]svn:mergeinfo [/B]property on a file (in the example, [B]/myProject/trunk/file.txt[/B][I])[/I], I get these pieces of information: [I]/myProject/branches/branch_013/file.txt:121-125 /myProject/branches/branch_019/file.txt:157-162 /myProject/branches/branch_023/file.txt:204-206 /myProject/trunk:197-199 /myProject/trunk/file.txt:197[/I] I interpret it this way: each line contains a "source" path that was merged to the "target" [B]/myProject/trunk/file.txt[/B] alongside the range of source revisions that were merged. I wonder how I can identify which target revision was created by the merge operation. Is there any other property that contains such an information? Or is it possible only by comparing the outputs of several [B]svnlook pg[/B] with different [B]-r[/B] options?

Last updated

DougR
DougR
The most comprehensive treatise I could find on "svn:mergeinfo" is here: [1] [URL]https://www.open.collab.net/community/subversion/articles/merge-info.html[/URL] Another one to read is: [2] [URL]https://resources.collab.net/blogs/where-did-that-mergeinfo-come-from[/URL] The simplest way to determine which merge created which target revision is to get the list of target revisions for the file/directory in question using "svn log" and then search backwards until the value of "svn:mergeinfo" no longer contains the source revision "entry" that you're looking for. The earliest to have the line in question is your answer. Well, maybe (see [2]). However, if you start using the "-r" option then you're going to have to deal with merge inheritance (see [1]). And that's going to be even more complicated to analyze. And, historical differences in behavior between, for example, SVN 1.5 and 1.6, will make things more difficult. Of course, and here's the rub, all of the above assumes that nobody was able to change those properties directly (e.g. "svn propdel"): if they did then "all bets are off". That includes the use of the "svn-mergeinfo-normalizer" tool (google it).

1-2 of 2

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.

Post a reply
13371 views