From dev-return-877-daniel=haxx.se@subversion.apache.org Tue Jan 5 15:05:12 2010 Return-Path: Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by giant.haxx.se (8.14.3/8.14.3/Debian-9) with SMTP id o05E5AtP006337 for ; Tue, 5 Jan 2010 15:05:11 +0100 Received: (qmail 82988 invoked by uid 500); 5 Jan 2010 14:05:06 -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 82927 invoked by uid 99); 5 Jan 2010 14:05:06 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jan 2010 14:05:06 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [209.85.219.227] (HELO mail-ew0-f227.google.com) (209.85.219.227) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jan 2010 14:04:56 +0000 Received: by ewy27 with SMTP id 27so4817940ewy.36 for ; Tue, 05 Jan 2010 06:04:36 -0800 (PST) Received: by 10.213.24.23 with SMTP id t23mr147347ebb.97.1262700276165; Tue, 05 Jan 2010 06:04:36 -0800 (PST) Received: from tcgws000 (183-019-045-062.static.caiway.nl [62.45.19.183]) by mx.google.com with ESMTPS id 15sm13309953ewy.4.2010.01.05.06.04.35 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 05 Jan 2010 06:04:35 -0800 (PST) From: "Bert Huijben" To: "'Philip Martin'" , "'Kannan'" Cc: "'SVN Dev'" References: <4B2FB0A6.8060809@collab.net> <4B39914E.1040605@collab.net> <4B3A00A5.6050305@collab.net> <871vi4u0y4.fsf@stat.home.lan> In-Reply-To: <871vi4u0y4.fsf@stat.home.lan> Subject: RE: [PATCH][v2] Sticky depths should work for an excluded dir Date: Tue, 5 Jan 2010 15:04:50 +0100 Message-ID: <02c101ca8e10$0c452740$24cf75c0$@qqmail.nl> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Outlook 14.0 Content-Language: nl Thread-Index: AQKSXgc35ARETVfGja72IgZoLkiluAMIF2GPAqASS2oB4bfKwAI4VtT+ X-Virus-Checked: Checked by ClamAV on apache.org > -----Original Message----- > From: Philip Martin [mailto:philip.martin@wandisco.com] > Sent: dinsdag 5 januari 2010 14:38 > To: Kannan > Cc: SVN Dev > Subject: Re: [PATCH][v2] Sticky depths should work for an excluded dir > > Kannan writes: > > > Make `--set-depth (empty|files|immediates) DIR' work, where DIR's depth > > had already been set as `exclude'. Only `infinity' works as of now. > > > > * subversion/libsvn_wc/crop.c > > (svn_wc_crop_tree2): Check the 'base status' of the node here and > > remove the check done using `svn_wc__db_node_hidden()' as it > > marks a node as 'hidden' if status is set as > > `svn_wc__db_status_excluded'. > > > > * update_editor.c > > (complete_directory): Call `svn_wc__set_depth' with the requested > > depth rather than `infinity' by default. > > > > * entries.c > > (svn_wc__set_depth): Set the entry's depth to the requested one rather > > than `infinity' by default if the depth is not `exclude'. > > > > * wc_db.c > > (svn_wc__db_temp_op_dir_set_depth): Remove the code which sets > the > > depth as `infinity' if the depth is not `exclude'. > > > > Patch by: Kannan R > > It looks plausible, but it would be much better if you included a > regression test that exercised the new code. If you fix something > like this without adding a test there is no guarantee that some future > change won't break it. > Index: subversion/libsvn_wc/entries.c > =================================================================== > --- subversion/libsvn_wc/entries.c (revision 893084) > +++ subversion/libsvn_wc/entries.c (working copy) > @@ -1567,10 +1567,7 @@ > : NULL; > > if (entry != NULL) > - { > - entry->depth = (depth == svn_depth_exclude) ? svn_depth_exclude > - : svn_depth_infinity; > - } > + entry->depth = depth; > } In entries we have two storage locations: On the parent entries file and on the entries file of the directory itself. For the depth argument the parent can only contain exclude and infinity. The more detailed statuses are in the second location. So this part is not necessary and likely to break old code relying on depth stored in entries. (WC-NG stores excluded as a separate status). > /* ### setting depth exclude on a wcroot breaks svn_wc_crop() */ > Index: subversion/libsvn_wc/wc_db.c > =================================================================== > --- subversion/libsvn_wc/wc_db.c (revision 893084) > +++ subversion/libsvn_wc/wc_db.c (working copy) > @@ -3120,9 +3120,6 @@ > if (flush_entry_cache) > flush_entries(pdh); > > - depth = (depth == svn_depth_exclude) ? svn_depth_exclude > - : svn_depth_infinity; > - > VERIFY_USABLE_PDH(pdh); > wcroot = pdh->wcroot; > sdb = wcroot->sdb; This code does the same thing on the WC-NG level. It updates the parent data, which in this case should only contain infinity, as with excluded the depth would be NULL. Bert