Re: Heuristics for merges
From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Thu, 30 Aug 2012 17:02:26 +0100 (BST)
Markus Schaber wrote:
I think you should be able to get a pretty reliable answer, given your restrictions, in most cases. You need to determine whether the most recent merge between these two branches was in the same direction or the opposite direction compared with the requested merge. Same direction => you need non-reintegrate. Opposite => you need reintegrate.
Pseudocode for a simplified method:
source_mi = get_repos_mergeinfo(source-branch-root-path)
target_mi = get_wc_mergeinfo(target-branch-root-path)
if relevant_source_mi && relevant_target_mi:
else if relevant_source_mi:
else if relevant_target_mi:
I haven't fully checked what APIs are available for this, but I see there is svn_client_mergeinfo_get_merged() which might be all you need.
Why do I say, "in most cases," "simplified," and "you probably need"? If the branch has been renamed, then simply filtering on the path of the other branch to find the "relevant" mergeinfo is not correct. (That's the "hash_get" step.) If you want this to work even when a branch has been renamed, then we need to dig deeper; let me know if you want help with that.
-- Subversion Live 2012 - 2 Days: training, networking, demos & more! http://bit.ly/NgUaRi Certified & Supported Apache Subversion Downloads: http://www.wandisco.com/subversion/downloadReceived on 2012-08-30 18:03:01 CEST
This is an archived mail posted to the Subversion Dev mailing list.