You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@gmail.com> on 2011/04/15 00:24:56 UTC

Re: svn commit: r1092530 - in /subversion/trunk/subversion/libsvn_wc: status.c update_editor.c wc.h

On Thu, Apr 14, 2011 at 18:04,  <rh...@apache.org> wrote:
>...
> +++ subversion/trunk/subversion/libsvn_wc/status.c Thu Apr 14 22:04:55 2011
> @@ -2370,28 +2370,30 @@ svn_wc_get_status_editor5(const svn_delt
>...
> +svn_wc__internal_walk_status(svn_wc__db_t *db,
> +                             const char *local_abspath,
> +                             svn_depth_t depth,
> +                             svn_boolean_t get_all,
> +                             svn_boolean_t no_ignore,
> +                             svn_boolean_t ignore_text_mods,
> +                             const apr_array_header_t *ignore_patterns,
> +                             svn_wc_status_func4_t status_func,
> +                             void *status_baton,
> +                             svn_wc_external_update_t external_func,
> +                             void *external_baton,
> +                             svn_cancel_func_t cancel_func,
> +                             void *cancel_baton,
> +                             apr_pool_t *scratch_pool)
>  {
> -  svn_node_kind_t kind;
>   struct walk_status_baton wb;
>   const svn_io_dirent2_t *dirent;
>   const char *anchor_abspath, *target_name;
>   svn_boolean_t skip_root;
> +  svn_error_t *err;
> +  svn_wc__db_status_t status;
> +  svn_wc__db_kind_t kind;

status is not used.

>...
> +++ subversion/trunk/subversion/libsvn_wc/update_editor.c Thu Apr 14 22:04:55 2011
>...
> @@ -1261,30 +1220,39 @@ modcheck_found_node(const char *local_ab
>  * *ALL_EDITS_ARE_DELETES to true, set it to false otherwise.  LOCAL_ABSPATH
>  * may be a file or a directory. */
>  static svn_error_t *
> -tree_has_local_mods(svn_boolean_t *modified,
> +node_has_local_mods(svn_boolean_t *modified,
>                     svn_boolean_t *all_edits_are_deletes,
>                     svn_wc__db_t *db,
>                     const char *local_abspath,
>                     svn_cancel_func_t cancel_func,
>                     void *cancel_baton,
> -                    apr_pool_t *pool)
> +                    apr_pool_t *scratch_pool)
>  {
> -  modcheck_baton_t modcheck_baton = { NULL, FALSE, TRUE };
> +  modcheck_baton_t modcheck_baton = { NULL, FALSE, FALSE };
> +  svn_error_t *err;
>
>   modcheck_baton.db = db;
>
> -  /* Walk the WC tree to its full depth, looking for any local modifications.
> -   * If it's a "sparse" directory, that's OK: there can be no local mods in
> -   * the pieces that aren't present in the WC. */
> -
> -  SVN_ERR(svn_wc__internal_walk_children(db, local_abspath,
> -                                         FALSE /* show_hidden */,
> -                                         modcheck_found_node, &modcheck_baton,
> -                                         svn_depth_infinity, cancel_func,
> -                                         cancel_baton, pool));
> +  /* Walk the WC tree for status with depth infinity, looking for any local
> +   * modifications. If it's a "sparse" directory, that's OK: there can be
> +   * no local mods in the pieces that aren't present in the WC. */
> +
> +  err = svn_wc__internal_walk_status(db, local_abspath,

How can this work for a file? It looks like walk_status will fail for
non-directory nodes. It calls get_dir_status() which then tries to
read children info and fetch dirents.

>...
> @@ -1596,32 +1564,16 @@ check_tree_conflict(svn_wc_conflict_desc
>
>         /* Check if the update wants to delete or replace a locally
>          * modified node. */
> -        switch (working_kind)
> -          {
> -            case svn_wc__db_kind_file:
> -            case svn_wc__db_kind_symlink:

Seems that something like this needs to stick around.

If not, then note that the 'working_kind' parameter is no longer used.

>...

Cheers,
-g

RE: svn commit: r1092530 - in /subversion/trunk/subversion/libsvn_wc: status.c update_editor.c wc.h

Posted by Greg Stein <gs...@gmail.com>.
On Apr 14, 2011 6:35 PM, "Bert Huijben" <be...@qqmail.nl> wrote:
>
>
>
> > -----Original Message-----
> > From: Greg Stein [mailto:gstein@gmail.com]
> > Sent: vrijdag 15 april 2011 0:25
> > To: dev@subversion.apache.org
> > Subject: Re: svn commit: r1092530 - in
> > /subversion/trunk/subversion/libsvn_wc: status.c update_editor.c wc.h
>
> > > -  SVN_ERR(svn_wc__internal_walk_children(db, local_abspath,
> > > -                                         FALSE /* show_hidden */,
> > > -                                         modcheck_found_node,
> &modcheck_baton,
> > > -                                         svn_depth_infinity,
> cancel_func,
> > > -                                         cancel_baton, pool));
> > > +  /* Walk the WC tree for status with depth infinity, looking for any
> local
> > > +   * modifications. If it's a "sparse" directory, that's OK: there
can
> be
> > > +   * no local mods in the pieces that aren't present in the WC. */
> > > +
> > > +  err = svn_wc__internal_walk_status(db, local_abspath,
> >
> > How can this work for a file? It looks like walk_status will fail for
> > non-directory nodes. It calls get_dir_status() which then tries to
> > read children info and fetch dirents.
>
> Walk status properly detects this case and has no problem with walking
only
> a single file in a directory. This is essentially what libsvn_client does
> for its status walk when it is not looking at a repository.
> (This is managed by the 'selected' argument of get_dir_status)

Ah! I see now. It pops up to the containing directory and picks out that
one.

Thanks,
-g

RE: svn commit: r1092530 - in /subversion/trunk/subversion/libsvn_wc: status.c update_editor.c wc.h

Posted by Bert Huijben <be...@qqmail.nl>.

> -----Original Message-----
> From: Greg Stein [mailto:gstein@gmail.com]
> Sent: vrijdag 15 april 2011 0:25
> To: dev@subversion.apache.org
> Subject: Re: svn commit: r1092530 - in
> /subversion/trunk/subversion/libsvn_wc: status.c update_editor.c wc.h

> > -  SVN_ERR(svn_wc__internal_walk_children(db, local_abspath,
> > -                                         FALSE /* show_hidden */,
> > -                                         modcheck_found_node,
&modcheck_baton,
> > -                                         svn_depth_infinity,
cancel_func,
> > -                                         cancel_baton, pool));
> > +  /* Walk the WC tree for status with depth infinity, looking for any
local
> > +   * modifications. If it's a "sparse" directory, that's OK: there can
be
> > +   * no local mods in the pieces that aren't present in the WC. */
> > +
> > +  err = svn_wc__internal_walk_status(db, local_abspath,
> 
> How can this work for a file? It looks like walk_status will fail for
> non-directory nodes. It calls get_dir_status() which then tries to
> read children info and fetch dirents.

Walk status properly detects this case and has no problem with walking only
a single file in a directory. This is essentially what libsvn_client does
for its status walk when it is not looking at a repository.
(This is managed by the 'selected' argument of get_dir_status)

	Bert