Return-Path: X-Original-To: apmail-subversion-dev-archive@minotaur.apache.org Delivered-To: apmail-subversion-dev-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id DCD5710483 for ; Wed, 5 Jun 2013 14:14:00 +0000 (UTC) Received: (qmail 99716 invoked by uid 500); 5 Jun 2013 14:13:43 -0000 Delivered-To: apmail-subversion-dev-archive@subversion.apache.org Received: (qmail 99683 invoked by uid 500); 5 Jun 2013 14:13:42 -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 99676 invoked by uid 99); 5 Jun 2013 14:13:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jun 2013 14:13:40 +0000 X-ASF-Spam-Status: No, hits=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of ivan@visualsvn.com designates 209.85.128.44 as permitted sender) Received: from [209.85.128.44] (HELO mail-qe0-f44.google.com) (209.85.128.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jun 2013 14:13:33 +0000 Received: by mail-qe0-f44.google.com with SMTP id 6so1078938qeb.3 for ; Wed, 05 Jun 2013 07:13:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=visualsvn.com; s=google; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; bh=Gm5k6VLWsGFM2/H/mgCxNg+0IFDmJxU5cvu4O2+UwcQ=; b=cu+JWrYvt2XyOkj6rJ2F1zDeTgV4RYyvGn6icUg8d7ieZsD4H4VHoIGId+/oqVcYWK ydtnjKb7gkZg+ZdFKfMmFK7sRfcC3y0xaTf+873xdt7mSJirZLV1xjfe2ihbDgjyb1dc UBKMxId7p2/BWClgm+kjq2Djye25MB5VXVBfM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type :x-gm-message-state; bh=Gm5k6VLWsGFM2/H/mgCxNg+0IFDmJxU5cvu4O2+UwcQ=; b=mYPFVBvh2nsA76fHMAUAFDyPaAB82srDgY6/FCFx/kuONU7pIOTMG0+epJ41D7/Vni kdVzSYokYX6+2z88bFHJb2jo4jSo6QXymPHoOU501jjPK9wY1SvgrDALw6bKp31QVLWk sigN8kbx5wNNwJSlw69xyY00GTtYJmevlRDgsrWzyLqahLbD6tSy1b3qKwpyp8L42Kg7 2eI8wH/2kS3HyPCKJ9sCynIfVFKy2puNhqI2YSxbcdfLIhuMngnGH/3XkgbehCHpr51f wZMnhgdqVWGk35r3QggndMWsLUdCfi/U56asD7t4LlyeUXoOjDYtEY7kHsXpURk8pQ9u rSQQ== X-Received: by 10.229.136.213 with SMTP id s21mr11652444qct.9.1370441592155; Wed, 05 Jun 2013 07:13:12 -0700 (PDT) MIME-Version: 1.0 Sender: ivan@visualsvn.com Received: by 10.229.90.65 with HTTP; Wed, 5 Jun 2013 07:12:52 -0700 (PDT) In-Reply-To: <1370382625.31924.YahooMailNeo@web186101.mail.ir2.yahoo.com> References: <20130531120233.29E442388847@eris.apache.org> <1370382625.31924.YahooMailNeo@web186101.mail.ir2.yahoo.com> From: Ivan Zhakov Date: Wed, 5 Jun 2013 18:12:52 +0400 X-Google-Sender-Auth: CmxU_pOc6ek1YIvT42hyvmiT00k Message-ID: Subject: Re: svn commit: r1488183 - /subversion/trunk/subversion/libsvn_client/merge.c To: Julian Foad Cc: Paul Burba , Subversion Development Content-Type: text/plain; charset=UTF-8 X-Gm-Message-State: ALoCoQmzt4fSmP8HYXSnL0kp3UJ/3VG/v0VxxwXM5RQjSLUcVlcqyhRSWeeQ2aH/y5Xp6/x7bNxJ X-Virus-Checked: Checked by ClamAV on apache.org On Wed, Jun 5, 2013 at 1:50 AM, Julian Foad wrote: > Paul Burba wrote: >> On Fri, May 31, 2013 at 8:02 AM, wrote: >>> URL: http://svn.apache.org/r1488183 >>> >>> --- subversion/trunk/subversion/libsvn_client/merge.c (original) >>> +++ subversion/trunk/subversion/libsvn_client/merge.c Fri May 31 12:02:32 >>> @@ -12415,14 +12415,15 @@ client_find_automatic_merge(automatic_me >>> source_and_target_t *s_t = apr_palloc(result_pool, sizeof(*s_t)); >>> automatic_merge_t *merge = apr_palloc(result_pool, sizeof(*merge)); >>> >>> - /* "Open" the target WC. We're not going to check the target WC for >>> - * mixed-rev, local mods or switched subtrees yet. After we find out >>> - * what kind of merge is required, then if a reintegrate-like merge is >>> - * required we'll do the stricter checks, in do_automatic_merge_locked(). */ >>> + /* "Open" the target WC. Check the target WC for mixed-rev, local mods and >>> + * switched subtrees yet to faster exit and notify user before contacting >>> + * with server. After we find out what kind of merge is required, then if >>> + * a reintegrate-like merge is required we'll do the stricter checks, in >>> + * do_automatic_merge_locked(). */ >> >> Hi Ivan, >> >> (Julian - ccing you as you originally added this bit of code that Ivan >> tweaked here) >> >> The comment is a bit misleading. We don't *unconditionally* check the >> target WC for mixed-rev, local mods, and/or switched subtrees, it >> depends on what the caller asks for. Yes, currently the only two >> callers of client_find_automatic_merge() unconditionally pass >> ALLOW_LOCAL_MODS=TRUE and ALLOW_SWITCHED_SUBTREES=TRUE, so the comment >> here is effectively true, but might not be in the future. >> I agree that comment a little bit confusing. Sorry. I'm fine with Juilan comment fix. >>> SVN_ERR(open_target_wc(&s_t->target, target_abspath, >>> - TRUE /*allow_mixed_rev*/, >>> - TRUE /*allow_local_mods*/, >>> - TRUE /*allow_switched_subtrees*/, >>> + allow_mixed_rev, >>> + allow_local_mods, >>> + allow_switched_subtrees, >> >> Since you were worried about performance with mixed-rev WCs, I wonder >> if this is better: >> >> [[[ >> - /* "Open" the target WC. We're not going to check the target WC for >> - * mixed-rev, local mods or switched subtrees yet. After we find out >> - * what kind of merge is required, then if a reintegrate-like merge is >> - * required we'll do the stricter checks, in do_automatic_merge_locked(). */ >> + /* "Open" the target WC. We're not going to check the target WC for local >> + mods or switched subtrees yet, but since the check for mixed-revisions >> + is cheap, easily violated, and required by most merges, check for that >> + now, before we go through the potentially lengthy process of contacting >> + the server -- It's bad form to make the user wait, only to learn that >> + they cannot merge due to the state of their WC: "Uh, why didn't you tell >> + me that at the start!" Later, if we determine that a reintegrate-like >> + merge is called for, then we'll do the local mod and switched subtree >> + checks in do_automatic_merge_locked(). */ >> SVN_ERR(open_target_wc(&s_t->target, target_abspath, >> - TRUE /*allow_mixed_rev*/, >> - TRUE /*allow_local_mods*/, >> - TRUE /*allow_switched_subtrees*/, >> + allow_mixed_rev, >> + TRUE, /* allow_local_mods */ >> + TRUE, /* allow_switched_subtrees */ >> ctx, result_pool, scratch_pool)); Working copy with local mods is also typical case IMHO. Is local mods check expensive? I'm fine to delay local mods and switched subtrees checks, but I think it's premature optimization: local operations generally fast, while remote is slow. -- Ivan Zhakov VisualSVN Team