[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] for 598 ("svn status <nonexistent-file>" fails to give an error)

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2002-02-07 18:48:37 CET

"B. W. Fitzpatrick" <fitz@red-bean.com> writes:
> Passes the stat_test.py test suite just fine. Please comment and I'll
> commit after review.

Looks good! Small comments below:

> Index: ./include/svn_wc.h
> ===================================================================
> --- ./include/svn_wc.h
> +++ ./include/svn_wc.h Thu Feb 7 08:55:50 2002
> @@ -358,6 +358,12 @@
> * a directory; its status will simply be stored in STATUSHASH like
> * any other.
> *
> + * If STRICT is non-zero, then if we encounter a path that is not in
> + * the wc, we'll return an error. STRICT should be zero if we're
> + * updating as the update will catch any non wc path errors (and
> + * properly deal with files that are in the repository but missing
> + * from the wc for whatever reason).
> + *

Clearer with a comma: "...if we're updating, as the update will..."
(I got the precedence wrong the first time I read it.)

> Index: ./libsvn_client/status.c
> ===================================================================
> --- ./libsvn_client/status.c
> +++ ./libsvn_client/status.c Thu Feb 7 09:05:28 2002
> @@ -139,6 +139,14 @@
> apr_pool_t *pool)
> {
> apr_hash_t *hash = apr_hash_make (pool);
> + svn_boolean_t strict = TRUE;
> +
> + /* If we're not updating, we might be getting new paths from the
> + repository, and we don't want svn_wc_statuses to error on these
> + paths. However, if we're not updating and we see a path that
> + doesn't exist in the wc, we should throw an error */
> + if (update)
> + strict = FALSE;

Given that the `update' flag is the deciding factor here, it might be
clearer for the code to match the logic written in the comment:

     [...]
     svn_boolean_t strict;
   
     /* If we're not updating, we might be getting new paths from the
        repository, and we don't want svn_wc_statuses to error on these
        paths. However, if we're not updating and we see a path that
        doesn't exist in the wc, we should throw an error */
     if (update)
         strict = FALSE;
     else
         strict = TRUE;
     [...]

-Karl

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Oct 21 14:37:05 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.