No announcement yet.

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

  • Filter
  • Time
  • Show
Clear All
new posts

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

    When I retrieve (using svnlook pg) the svn:mergeinfo property on a file (in the example, /myProject/trunk/file.txt), I get these pieces of information:


    I interpret it this way: each line contains a "source" path that was merged to the "target" /myProject/trunk/file.txt 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 svnlook pg with different -r options?

  • #2
    The most comprehensive treatise I could find on "svn:mergeinfo" is here: [1]
    Another one to read is: [2]

    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).