About merges in Subversion

This page explains how FishEye manages merge operations in Subversion, and provides examples of supported and unsupported merge formats.

 

 

Merge definition

Subversion allows you to reapply changes made on other branches to the current working branch using the merge operation. For example, merging allows you to reintegrate a feature branch with trunk, or to reapply changes made on trunk to the current working branch. Subversion tracks this information in the dedicated svn:mergeinfo path property. FishEye detects changes in those properties and uses those to mark parents of a changeset accordingly, effectively exposing merges between branches.

Notes:

  • Although the path property might be set manually by using the propset command, FishEye trusts this information blindly, which means that if you add a required property in a correct format, FishEye will resolve parents for a changeset accordingly.
  • The versions of the Subversion client and server used to perform merges both need to be version 1.5 or higher, since earlier versions do not have svn:mergeinfo. FishEye supports only branch and trunk path roots merges.

How FishEye shows merge information

Changeset merges are exposed in three places:

  • commit graph
  • changeset view
  • REST and Java API

Note: Although merge information is processed, changes on different branches are not reflected in the file ancestry history.

Commit graph

Changeset view

 

 

Acceptable path property format

FishEye uses the svn:mergeinfo property. It is set on a target path to which revisions has been merged and contains information about the revisions or revision range that has been merged, and the source of the merge. FishEye supports only base branches merge, which means that only the following format is acceptable:

(Source branch):(Range revision start)-(Range revision end)

 

For example:

/branches/feature-branch-1:10-15

However if none of the changesets in the range <10,15> made actual changes to feature-branch, (or those changes are not recognised as such by FishEye due to, for example, the included/excluded paths), the merge information won't be reflected.

 

Merge targets and sources

FishEye supports only branch and trunk path merges, which means that proper configuration of the repository structure is crucial. If the mergeinfo property is applied on a path that isn't identified as a branch or trunk root by SVN rules, it won't be processed. The same applies to mergeinfo value which describes the source of a merge. If it's not a branch/trunk root, or it's excluded by include/exclude paths, it won't be processed or reflected in FishEye. 

Considering the basic(built-in) rules and recommended repository structure, the following merge properties will be recognized:

Property changes on: branches/example-branch
___________________________________________________________________
Added: svn:mergeinfo
   Merged /trunk:r2-3

But the following will not be recognized:

Property changes on: trunk/directory
___________________________________________________________________
Added: svn:mergeinfo
   Merged /branches/example-branch/directory:r2-5

Unsupported operations

Advanced merging

None of the operations described on this site are supported by FishEye. Cherry picking revisions may result in mergeinfo formats similar to the following, which won't be recognized:

/branches/example-branch:5703
/trunk:4622,5065,5300,5395,5403,5410-5414,5419,5423-5425


However, if you cherry pick revisions to create a valid revision range, it will be reflected in FishEye. For example, doing a couple of consecutive merge operations might result in a ranged svn:mergeinfo property format. Such a situation happens on the second merge command, which will transform svn:mergeinfo to contain the value /example-branch:8-9. In that case, FishEye will recognize it as a valid merge in the latest commit and mark it accordingly.

$ svn merge -c 8 ^/branches/example-branch && svn commit
$ svn merge -c 9 ^/branches/example-branch && svn commit
Last modified on Jun 28, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.