From users-return-28779-archive-asf-public=cust-asf.ponee.io@subversion.apache.org Wed Jul 22 15:49:55 2020 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mailroute1-lw-us.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 74E8B180643 for ; Wed, 22 Jul 2020 17:49:55 +0200 (CEST) Received: from mail.apache.org (localhost [127.0.0.1]) by mailroute1-lw-us.apache.org (ASF Mail Server at mailroute1-lw-us.apache.org) with SMTP id 50A62128563 for ; Wed, 22 Jul 2020 15:49:48 +0000 (UTC) Received: (qmail 56001 invoked by uid 500); 22 Jul 2020 15:49:45 -0000 Mailing-List: contact users-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@subversion.apache.org Received: (qmail 55982 invoked by uid 99); 22 Jul 2020 15:49:45 -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; Wed, 22 Jul 2020 15:49:45 +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 7E544C04BB for ; Wed, 22 Jul 2020 15:49:44 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.199 X-Spam-Level: X-Spam-Status: No, score=-0.199 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, URIBL_BLOCKED=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-he-de.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id IyW_aWO6xyWN for ; Wed, 22 Jul 2020 15:49:43 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=2607:f8b0:4864:20::102e; helo=mail-pj1-x102e.google.com; envelope-from=sebbaz@gmail.com; receiver= Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by mx1-he-de.apache.org (ASF Mail Server at mx1-he-de.apache.org) with ESMTPS id 9A76F7F6D6 for ; Wed, 22 Jul 2020 15:49:42 +0000 (UTC) Received: by mail-pj1-x102e.google.com with SMTP id mn17so1715137pjb.4 for ; Wed, 22 Jul 2020 08:49:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=yhzNO0CYTl4AnjEweDATC9a3983NMa7O38Rws2wogVE=; b=OtC8ENNoSaqqy63k+mHpLubC1Y7MIfP8XDfMMT7gRhKfphRtFUWJaoF/qguj4YfQSE B3gY4l+/jd7vXohrmQxamrCrxMlpDMgx4PQJIuvW8XwtKbKPUHExWmyFhGTifHeXpYgl ecjnwdraeE9gEO2NErXCLW9lmDO3TQJ+pWg+8AHvu8043CVkLImh+ejRDqIIvz55ycIA pKBuYsauoHtc6qvImVsv8f1k4MaprRplDI7mEQ4m6/p4Gss6ZJMBLfbm3IOH88ivMvVD W2yjw6h89SCdtQ55cLrTVadBD3nCS9Bqso+TpxWSpH3C9aS8lZEdf+ZuQhGiNRyeO9Xb gq1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=yhzNO0CYTl4AnjEweDATC9a3983NMa7O38Rws2wogVE=; b=g0HuisxZBti09AAgFv7ZBeVbvbIqX9XQOZctXGuWt7UniZAI8jmRv8FhKoEvaBZiXe 8EejBDpSKvLKHrV/OhpCK9a72sdEppWxxm/Nno6/274lJvuTTkO36tY+KBrtSX+vMK04 x1aL3yzjezJU8WvSyI3jXHa3oX2NZm3NldWypY1/eWHJuNZSq3Jmh3BnH03o92RfoD9N sdgY60oBMeKRZ6lTT7TsNNnEX6HmLXDcVJJMFsDwrcnaWLnCttBlsGv+mSbHymS00S2D 7sbJCcyef7xjBDHcOBrusc9HIigr0vqZFw9PjzHacmNy2pvGis19rlFWlaDWwN33nNfP Mqgw== X-Gm-Message-State: AOAM532TBVCHjnpWaSkClSK+K1z3CqeLIdyClh4SP+qVu/At5POuPMor UoKWgXskssvbRp7T50cRXwIiTAtMcYot+8LGKhGr6Q== X-Google-Smtp-Source: ABdhPJzQrrBzDj/rKmK+A8QIcKUy873n7BrquYrVVL/a5TrveLPWk7D1ZGo/+3zvKxI4UlpfQOF30tFBru1u/FaECig= X-Received: by 2002:a17:90a:3769:: with SMTP id u96mr55674pjb.198.1595432975208; Wed, 22 Jul 2020 08:49:35 -0700 (PDT) MIME-Version: 1.0 References: <20200712142604.128f80eb@tarpaulin.shahaf.local2> <20200712171348.0a9e99bd@tarpaulin.shahaf.local2> In-Reply-To: <20200712171348.0a9e99bd@tarpaulin.shahaf.local2> From: sebb Date: Wed, 22 Jul 2020 16:49:24 +0100 Message-ID: Subject: Re: svnmucc --revision 0 no longer works when creating a file To: Daniel Shahaf Cc: users@subversion.apache.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Sun, 12 Jul 2020 at 18:13, Daniel Shahaf wrote: > > sebb wrote on Sun, 12 Jul 2020 16:55 +0100: > > On Sun, 12 Jul 2020 at 15:26, Daniel Shahaf wr= ote: > > > > > > sebb wrote on Tue, 07 Jul 2020 20:43 +0100: > > > > When I first started using svnmucc, it used to be the case that > > > > svnmucc 'put' --revision 0 would fail if the target file already > > > > existed. This no longer happens. > > > > > > > > > > Is the file-to-be's parent directory the root directory? > > > > No, it's not. > > > > > If that isn't the case, then the new behaviour is correct. > > > > Why is that? > > > > Because the target of the 'put' operation didn't exist at r0, and the > base revision is specified to be a revision in which the target of the > operation existed. (See svn_delta_editor_t::open_root()'s docstring.) > > Moreover, even that syntax it did work, it should arguably fail if the > file had been created and subsequently deleted, which isn't the same > semantics as the algorithm you posted. > > > > You might wish to post the error message. > > > > Just tried with a local SVN repo: > > > > $ svnmucc -mBug --revision 0 -- put /dev/null > > file:///var/tools/svnrep/asf/x/b.tmp > > svnmucc: E160016: Can't commit to 'file:///var/tools/svnrep/asf/x' > > because it is not a directory > > > > That message is wrong, because /x/ *is* a directory. > > Runnable reproduction recipe, please. > > I wonder if the error is reported because /x isn't a directory _at r0_, > per the above explanation. What happens if you try to put a file into > the root directory? If you keep the target as-is but change the value > of the --revision argument to the revision in which ^/x was created? To > the revision just before that? > > > The same error occurs regardless of whether b.tmp is present. > > > > > > The previous behaviour was very useful, so are there any plans to r= einstate it? > > > > > > > > > > Patches welcome. (You'll have to propose a new syntax, of course.) > > > > --revision -1 > > -1 actually already has a meaning (SVN_INVALID_REVNUM). More > importantly, this approach makes it impossible to specify a base > revision if any single operation is a "create exclusively" operation. > Shouldn't the new syntax be per-operation, so people could combine > "create exclusively" operations, "create or update" operations, and > other kinds of operations in the same command line, _and_ have the > option of specifying a base revision as well? > > > > > I don't think there is a straightforward way to guarantee the same > > > > behaviour now. > > > > > > > > > > Try: > > > > > > svn checkout --depth=3Dempty $URL wc > > > cd wc > > > svn up --set-depth=3Dinfinite iota > > > touch iota > > > svn add iota > > > svn commit -mm > > > svn up --set-depth=3Dempty iota > > > svn cleanup # prune .svn/pristine > > > > Not exactly straightforward, but it does fail if the file has been > > created meanwhile > > However the error response still has to be analysed > > > > Also the script can fail in at least two places, depending on when the > > file is created. > > > > And why is that a problem? > > In the future, please provide all the needed information (reproduction > recipes, error messages, the answer to "Why is it a problem?") up front. > I don't intend to guess the missing parts and I don't have the > brainwidth to prompt you every time. > > > > > The closest I could get is: > > > > > > > > 1) get current parent directory revision > > > > 2) check if target file does not exist. This is not as easy as it > > > > sounds, as the target directory may have too many files to list > > > > efficiently, and any other file-based command may fail for a reason > > > > other than a missing file. > > > > > > How is =C2=ABsvn info $URL/to/file@$REV=C2=BB not sufficient? You ca= n use > > > $URL/to{,/file}@$REV if you want, too. > > > > Same issue: svn info only returns success if the file exists. > > An error may mean the file did not exist or something else, so the > > error text has to be analysed. > > Use the machine-parseable E000042 error codes. That's exactly what > they're for. (which-error.py and svn_error_symbolic_name() can be used > to convert numbers to symbolic names.) Where are these error codes defined? I could not find any reference to them in the documentation. > > > > 3) Put the file using the revision obtained in step 1. > > > > AFAICT this is guaranteed not to replace an existing file. > > > > > > > > However it may fail to create the file if the target directory has > > > > been updated in the meantime. > > > > > > > > It's only safe to repeat the attempted create if the command failed > > > > due to an out of date revision. > > > > So the failure reason will have to be analysed. > > > > > > What part of the above is a problem, and why? > > > > It requires analysing the error response, which is likely to be fragile= . > > See above.