From users-return-27351-archive-asf-public=cust-asf.ponee.io@subversion.apache.org Thu Jul 26 16:20:10 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id A6FA4180621 for ; Thu, 26 Jul 2018 16:20:09 +0200 (CEST) Received: (qmail 67810 invoked by uid 500); 26 Jul 2018 14:20:08 -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 67800 invoked by uid 99); 26 Jul 2018 14:20:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Jul 2018 14:20:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 6D296C087C for ; Thu, 26 Jul 2018 14:20:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1 X-Spam-Level: * X-Spam-Status: No, score=1 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_NONE=-0.0001] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id ff8DKrAI04rQ for ; Thu, 26 Jul 2018 14:20:02 +0000 (UTC) Received: from mout.kundenserver.de (mout.kundenserver.de [212.227.126.130]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 951345F4AA for ; Thu, 26 Jul 2018 14:20:01 +0000 (UTC) Received: from JENSPC ([185.61.167.41]) by mrelayeu.kundenserver.de (mreue002 [212.227.15.163]) with ESMTPSA (Nemesis) id 0MIDV8-1fi8tS3NNu-003z4s; Thu, 26 Jul 2018 16:20:01 +0200 From: "Jens Restemeier" To: "'Stefan Sperling'" Cc: References: <036c01d424c7$b20dfce0$1629f6a0$@playtonicgames.com> <20180726105221.GD8687@ted.stsp.name> <038501d424d7$8ccc8810$a6659830$@playtonicgames.com> <20180726134559.GE8687@ted.stsp.name> In-Reply-To: <20180726134559.GE8687@ted.stsp.name> Subject: RE: svn add option to record replaced files as modified? Date: Thu, 26 Jul 2018 15:20:00 +0100 Message-ID: <039e01d424eb$bdf1ec50$39d5c4f0$@playtonicgames.com> MIME-Version: 1.0 Content-Type: text/plain; charset="Windows-1252" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 16.0 Content-Language: en-gb Thread-Index: AQFidTclZfZoZ8U3KTMH0bK+gDiYFAOqw0m3AhHGZ7YBd2fddKVLSelg X-Provags-ID: V03:K1:alK8R7GYwrR/701/jWjLTAys0Etd71JL8mfb5doFwOkyBfw07FM 2k1D0l3Ob01K/huoMPLbfGWm3y8VoqWIa9Rn3Ktf0fSV2djp8uNeo809trNp+B2aJ5RTp13 R5071DuI1hrj4pddrc3PZkFjR+klfOEA3sEJDkaVXRGslpMBlbwiQHwILj+yVB8V6amh2nA dn+PIChAFqLQo/BlEF2Yw== X-UI-Out-Filterresults: notjunk:1;V01:K0:qfdcYQ2rmaY=:nagmhs/lMaYul0EwKTfd7X GZb1XEiF5CShMMNkjnUN0puGF9LUD84khkfeaLgtz1p/IIAHIs41Y7N+mzIi7wUya6JA6mztk loB+IhDqoMOlSmaBjel4eLwSwwfjcHf6sRcwy6Zid/LR1rqaDbyAXs+J0LpjNZi81vjuhoQKK I3QYYvGu+iJubTQ2Wp+xTYPS1GRvr3yfdP363E9uue6DgQXWPqHhjOaldMDYfZcZGDGk6J5l9 cMbqgz3yMGD5ZEDbs1PzWrLjX0GPwTGESwybL6AkBwt3W37W9Gvi2Gqx/9kCb3Sv6q7sqAK1J p6Nlb25OjtUhNk/xjRzZIC1X83NJJOAmuENcCr9tiLO2wNSpVqWsT74O0oez6GTz6TLuSW3t5 gnDbCdmeF9rxBy41S+0ZXvSr7Bnvb2WE1msqpsXof8xqS+Acsyl0D4Jwd3tqN1TBkOCU1mPY8 bkoCNq8CH7mX1lLE9Pgbr4Q6YF4kuBdFVz/n1LcuOfTFaBUnXKOSt//fJCoIYTVOvkIDZh2cc SigJndtQi455e2QR77x3ep9A/x9CoqFxaizVmNJz0I6NLkR9eJ7klKm6ju6VKdjJdfSwB8TSX +t7/w3yMbI1i6hv33ZmjLFz8vT04dW08W3Hd55ffl8EvMiz2v5El82CZ4EDgr2Xu4BU+IojU9 u0EnO5TnKtdQvqu9E8zGefNTg/EYUhcQBA5DM0dOGLE+qjr4jaWB9GrYf2Q5uuv2XDYiHBaWT Rv0GmMQt+48jC/Zz Yes, I'm using the SVN APIs directly. I must have missed the option in svn_client_revert3, so I'll change the code to use it. Thanks for the suggestion! By the way, I'm already making use of the metadata_only option in svn_client_move7, because I get the move callback after the application has already moved the file. That doesn't seem to be exposed in the command line client, either. Mercurial "hg move" has an option -A/--after to record moves after they have already happened. -----Original Message----- From: Stefan Sperling Sent: 26 July 2018 14:46 To: Jens Restemeier Cc: users@subversion.apache.org Subject: Re: svn add option to record replaced files as modified? On Thu, Jul 26, 2018 at 12:55:29PM +0100, Jens Restemeier wrote: > The decision to delete and recreate the file is done outside the svn > integration, and I only get messages when a file is deleted or has > been saved. I could keep track which files are added or deleted and > collapse events for the same file, but there is a risk that this > information is lost when the plugin is reloaded, and I can't guarantee > that I get a message when the application quits. Both the case of > missing a file delete and file add can cause problems, so it is safer to update the svn workspace right away. Are you relying on the svn command line interface to write your integration? If so, have you considered using the SVN APIs directly? This would generally be the preferred way of implementing such an integration, and the API already provides the semantics you need. A revert can already be performed as a meta-data only operation at the WC API level, see svn_client_revert3(). This will allow you to revert the deleted file to a 'normal' state without touching any of the user-visible files in the working copy. Of course, this suggestion only helps you if SVN bindings for your programming language exist. If that is not the case, then maybe rather than changing 'svn add', adding a corresponding option to 'svn revert' would help you? ('svn revert --keep-local' might make sense, since a --keep-local option already exists for 'svn delete') Note that libsvn_client does not expose this functionality yet. So the command line client would probably need a new wrapper API at the client library layer as well in order to expose this feature to the command line user. But this should be rather straightforward. > The advantage of handling it inside "svn add" is that it doesn't > require changes to files in the workspace - when moving files there is > always the risk of errors from filename collisions or file locks by > the OS, while the client just needs to set a different flag in the internal database. The WC database is quite complex and I would refrain from bypassing the already existing operations when manipulating it. There is not just a simple flag in the WC database. There's a row in the NODES tables which corresponds to the deleted layer. What you'd need to do is remove that row and any potential additional rows representing extra layers (i.e. replacements) on top. Which is exactly what the 'revert' operation does. With that in mind, an implementation inside 'svn add' seems out of place.