[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: wish for new API or extended one

From: Stefan Kueng <tortoisesvn_at_gmail.com>
Date: Tue, 7 Feb 2017 20:17:41 +0100

On 07.02.2017 09:37, Stefan Sperling wrote:
> On Mon, Feb 06, 2017 at 07:54:46PM +0100, Stefan Kueng wrote:
>>
>>
>> On 06.02.2017 13:19, Stefan Sperling wrote:
>>> On Sun, Feb 05, 2017 at 03:23:33PM +0100, Stefan Küng wrote:
>>>> Still doesn't work for me.
>>>>
>>>> svn_client_conflict_option_set_moved_to_repos_relpath(opt, j, scratchpool);
>>>> label = svn_client_conflict_option_get_label(opt, scratchpool);
>>>> description = svn_client_conflict_option_get_description(opt, scratchpool);
>>>>
>>>> setting the moved-to path and then getting the description again does not
>>>> update the description nor the label.
>>>>
>>>> Stefan
>>>
>>> Yes, there were still some bugs to fix. As of r1781889, it works as expected
>>> for me. See the transcript below. I have added annotations in square brackets
>>> like this: [[ ... ]] so you can more easily follow which behaviour I am
>>> focussing on.
>>
>> [snip]
>>
>> Thanks for the info, but I think we're not talking about the same thing.
>> What works now is that the tree description gets updated.
>> But what I want to have updated is the tree *option* description:
>>
>> svn_client_conflict_option_get_description vs.
>> svn_client_conflict_tree_get_description
>>
>> I'd like to have the option description updated with the new path, because
>> that's what I want to use in the button text.
>>
>> Stefan
>
> We are starting to go in circles.
>
> The option description is indeed being updated in my example:
>
> Before:
>
> (m) - move and merge local changes from 'alpha' into 'alpha2'
>
> After:
>
> (m) - move and merge local changes from 'alpha' into 'alpha3'
>
> Please show me exactly which string you are referring to.
> Best is probably to show me the output you see vs the output you expect.
> Otherwise I won't understand where I should start looking for the problem.

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?

Stefan

-- 
        ___
   oo  // \\      "De Chelonian Mobile"
  (_,\/ \_/ \     TortoiseSVN
    \ \_/_\_/>    The coolest interface to (Sub)version control
    /_/   \_\     http://tortoisesvn.net
Received on 2017-02-07 20:17:49 CET

This is an archived mail posted to the Subversion Dev mailing list.