On Tue, Feb 07, 2017 at 08:17:41PM +0100, Stefan Kueng wrote: > I figured out the problem: > to get updated descriptions, I have to call > svn_client_conflict_tree_get_resolution_options() again to get new updated > options. I can't just get the description from the option I set the move > target index to. > > this won't work: > svn_client_conflict_option_set_moved_to_abspath(opt, j, m_pctx, > scratchpool); > > label = svn_client_conflict_option_get_label(opt, scratchpool); > description = svn_client_conflict_option_get_description(opt, scratchpool); > > > but this works: > svn_client_conflict_option_set_moved_to_abspath(opt, j, m_pctx, > scratchpool); > > // now get the resolution options again, so the label/description is > // properly updated. > apr_array_header_t *opts; > SVNTRACE( > Err = svn_client_conflict_tree_get_resolution_options(&opts, m_conflict, > m_pctx, > result.GetPool(), scratchpool), > path > ); > auto o = svn_client_conflict_option_find_by_id(opts, id); > > label = svn_client_conflict_option_get_label(o, scratchpool); > description = svn_client_conflict_option_get_description(o, scratchpool); > > > maybe the docs should be updated to say that a call to > svn_client_conflict_tree_get_resolution_options is required to get updated > strings?
I'm guessing that you are mixing up repository paths and working copy paths. Perhaps your expectation is that a repository-side path in the conflict description is changed by svn_client_conflict_option_set_moved_to_abspath()? If you do, then the API's behaviour will seem confusing indeed. There are two kinds of paths which can be selected: svn_client_conflict_option_set_moved_to_repos_relpath() selects the repository path which corresponds to the move target. This is the important path to worry about. In the example I gave earlier, this selects between '^/trunk/alpha2' and '^/trunk/alpha3'. Your examples don't seem to be calling this function. Because of copies and because of switched subtrees, multiple representations of a given repository relpath can exist in the working copy. Once the repository path is selected, you can choose a corresponding path in the working copy with svn_client_conflict_option_set_moved_to_abspath(). In my example, this will be 'alpha2' if the selected repository path is '^/trunk/alpha2', and it will be 'alpha3' if the selected repository path is '^/trunk/alpha3'. So in my example there is only one possible working copy path, and its value depends on the selected repostiory path. If this is still unclear, please show the exact text of the descriptions you are seeing, so I can see the full paths involved and I can find any faulty description texts in the source code. And please also explain which path is wrong and what it should be instead. Just to avoid misunderstandings. It also seems clear that the API documentation needs to be improved. I am very open to suggestions, and will definitely try to improve it when this dicussion is resolved! Please keep in mind that you are effectively beta testing the API documentation, which I am very grateful for :) Hope this helps, Stefan