subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bert Huijben" <b...@qqmail.nl>
Subject RE: [PATCH][v2] Sticky depths should work for an excluded dir
Date Tue, 05 Jan 2010 14:04:50 GMT


> -----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 <kannanr@collab.net> 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 <kannanr@collab.net>
> 
> 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


Mime
View raw message