Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 75A94200C14 for ; Tue, 7 Feb 2017 22:21:12 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 74491160B68; Tue, 7 Feb 2017 21:21:12 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 9A276160B32 for ; Tue, 7 Feb 2017 22:21:11 +0100 (CET) Received: (qmail 2726 invoked by uid 500); 7 Feb 2017 21:21:10 -0000 Mailing-List: contact dev-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list dev@subversion.apache.org Received: (qmail 2716 invoked by uid 99); 7 Feb 2017 21:21:10 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 07 Feb 2017 21:21:10 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 18732C0896 for ; Tue, 7 Feb 2017 21:21:10 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 0.379 X-Spam-Level: X-Spam-Status: No, score=0.379 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id dHZSOhctPyDP for ; Tue, 7 Feb 2017 21:21:09 +0000 (UTC) Received: from mail-wm0-f51.google.com (mail-wm0-f51.google.com [74.125.82.51]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id A978D5F1E9 for ; Tue, 7 Feb 2017 21:21:08 +0000 (UTC) Received: by mail-wm0-f51.google.com with SMTP id r141so168847622wmg.1 for ; Tue, 07 Feb 2017 13:21:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=UHdiD79a7N1HnPHkYguddsIg5zY+JajBpsrNGfgifRY=; b=hkqig4rOOb5aTbv5YDGAoSaLr+DQ2qul7XRuUI/LC7LPGTgxidUAUyz+pIn71hJSsl G5SU054wZ26QEFAXRnoF7RYdkopJBzcIasmCqzyb102T/Q2GEYFbdSiimFvu1d8V1Edj Eq1tH4/u4LGfv8oXw3nT1AVbCmZuGHnD0uDsiI75THAOj8YW1+KyWS2tfo6Ix7wZQfK7 yL4DFSSBMij2gt9sb3mg+qqqbwHU64kkw3JGgndG428LsLBhaSUs9WZRPblRASY1C74i 6w9t1aP/5TbMF7jO7se9Pz9a3d+NC83PTjeM+Zfevcz0FE62e58bJEr/biss+6BZf3QE J0OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=UHdiD79a7N1HnPHkYguddsIg5zY+JajBpsrNGfgifRY=; b=k81tDo6OwYiHneMefnn1VCtQwNTgol/IAtd4q5R5ngTor0Gc8LLR1GxaaYQWNyg2W+ 0IrBveyhem/TvhV9H0xfo1ovBnLvaZWcg0BZPJIFTwE+teknoZ/UBtsXeHkZoFcNfB54 9Z3Q2QHxfo6fLuG2Wcg+nTGNnK8tILb+ylsIN6fFhJqRLooV048ZQJYpsjjWBuMvp63V Rguag/DfT76XsMjzN9I/5FAj5BFOgl/xVaddLPqsISbpCz2uP7ReRqa2DF94Ur/VHF6/ E2kC7i16iEnhJQYoolGIido1KQu4r4XR8H36IFl/386AgDk/3UCUi0mukwwRD6q+KwNj hGFA== X-Gm-Message-State: AMke39l8rUkWaPoOgcUxFXAe1Tq0aGf6Qbjn31uuERXIENGB2Jzp0Is1+10GnU08vxQI4Q== X-Received: by 10.28.9.148 with SMTP id 142mr14130832wmj.24.1486502464629; Tue, 07 Feb 2017 13:21:04 -0800 (PST) Received: from [192.168.1.120] (cable-static-20-197.rsnweb.ch. [88.84.20.197]) by smtp.googlemail.com with ESMTPSA id l37sm9333716wrc.41.2017.02.07.13.21.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 07 Feb 2017 13:21:04 -0800 (PST) Subject: Re: wish for new API or extended one To: Subversion Development References: <6a1d3ef8-8888-5ca4-f036-f33fa4c078c7@gmail.com> <20170204182149.r3uk7k7nl3b7mmqo@jim.stsp.name> <20170204185242.dxiabcuzl5rxnzvg@jim.stsp.name> <20170206121955.wkpqq2flqoj24jr5@jim.stsp.name> <5511092b-2416-d681-14b1-5995f16cbf57@gmail.com> <20170207083733.GC74872@ted.stsp.name> <7d555894-1245-69d2-56fb-050dbfa305ff@gmail.com> <20170207203444.gnwvdbq7eqrckbsk@jim.stsp.name> From: Stefan Kueng Message-ID: Date: Tue, 7 Feb 2017 22:21:04 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <20170207203444.gnwvdbq7eqrckbsk@jim.stsp.name> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit archived-at: Tue, 07 Feb 2017 21:21:12 -0000 On 07.02.2017 21:34, Stefan Sperling wrote: > 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. Sorry, my mistake: I copied the wrong part of the code above. Here's what I'm doing now: apr_array_header_t *possible_moved_to_repos_relpaths = nullptr; Err = svn_client_conflict_option_get_moved_to_repos_relpath_candidates (&possible_moved_to_repos_relpaths, opt, result.GetPool(), scratchpool); if ((Err == nullptr) && possible_moved_to_repos_relpaths && (possible_moved_to_repos_relpaths->nelts > 1)) { for (int j = 0; j < possible_moved_to_repos_relpaths->nelts; ++j) { svn_client_conflict_option_set_moved_to_repos_relpath(opt, j, scratchpool); // now get the resolution options again, so the label/description is // properly updated. // Note: without this, the label and description text is NOT updated! // calling svn_client_conflict_option_get_description on 'opt' // instead of 'o' will get the existing description, not the // updated one, even though we set the move index on 'opt'. 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); if (0 == nullptr) continue; label = svn_client_conflict_option_get_label(o, scratchpool); description = svn_client_conflict_option_get_description(o, scratchpool); result.push_back(std::unique_ptr(new SVNConflictOption(o, id, CUnicodeUtils::GetUnicode(label), CUnicodeUtils::GetUnicode(description), -1, j))); bResultAdded = true; } } But as I mentioned: without getting the options again with svn_client_conflict_tree_get_resolution_options, the strings are not updated. If you look at the svn code: the svn_client_conflict_option_set_moved_to_repos_relpath call sets the index to the options object, but does *not* update the strings, and svn_client_conflict_option_get_description just returns the already created string. Stefan -- ___ oo // \\ "De Chelonian Mobile" (_,\/ \_/ \ TortoiseSVN \ \_/_\_/> The coolest interface to (Sub)version control /_/ \_\ http://tortoisesvn.net