On Fri, Dec 18, 2009 at 12:25 PM, Julian Foad <julian.f...@wandisco.com> wrote: > Paul, > > I was looking at > subversion/libsvn_client/merge.c:find_unmerged_mergeinfo() to review a > recent bug fix for back-port. > > It is said to be a "Helper for calculate_left_hand_side()", but I > noticed it seems to be basically a function for comparing one mergeinfo > catalog with another, to see what has not been merged from one to the > other. That sounds like the same kind of calculation that normal merges, > and the "svn merginfo" command, perform. > > Is there not an existing function we can use for this purpose?
Hi Julian, Regarding the commonality between reintegrate merges and regular merges: There isn't any single function for the latter analogous to find_unmerged_mergeinfo(). Rather it is do_directory_merge() and its legion of helpers. Keep in mind that a regular merge must deal with a working copy target and all this entails: mixed revisions, local modifications, switched subtrees, subtrees missing due to authorization restrictions, text/tree conflicts created by earlier editor drives, etc. find_unmerged_mergeinfo() doesn't have to deal with any of this, in fact it doesn't even need the working copy because during a reintegrate merge it is asking, not about the reintegrate WC target, but rather about what has previously been merged from the WC target to the reintegrate source. But you are probably onto something with the svn mergeinfo command. The new 1.7 svn_client_mergeinfo_log API is smart enough the handle subtree mergeinfo, so it could probably replace some/all of the code currently in libsvn_client/merge.c:find_unmerged_mergeinfo() and ensure_all_missing_ranges_are_phantoms(). Paul > (Of course this function takes its input in a specific format, and > generates several specific output indications, but those are details > that could be wrapped around a generic "compare mergeinfo catalogs" > function.) > > - Julian