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

Re: svn commit: rev 2943 - trunk/subversion/libsvn_wc

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2002-08-12 18:24:19 CEST

rooneg@tigris.org writes:
> * subversion/libsvn_wc/adm_files.c
> (check_adm_exists): trade an open and a close for a stat. since we don't
> actually care about the contents of the .svn/README file, just that it is
> there, there's no reason to bother opening it.

Sorry, I thought the proposal was to change this to an
svn_io_check_path(), and then test that kind == svn_node_dir. That
boils down to a stat under the hood anyway, but is more stylistically
consistent with the rest of Subversion, and (very slightly) safer too.

??,
-K

> Modified: trunk/subversion/libsvn_wc/adm_files.c
> ==============================================================================
> --- trunk/subversion/libsvn_wc/adm_files.c (original)
> +++ trunk/subversion/libsvn_wc/adm_files.c Sun Aug 11 17:11:15 2002
> @@ -924,8 +924,8 @@
> svn_error_t *err = NULL;
> enum svn_node_kind kind;
> svn_boolean_t dir_exists = FALSE, wc_exists = FALSE;
> - apr_file_t *f = NULL;
> const char *tmp_path;
> + apr_finfo_t finfo;
>
> /** Step 1: check that the directory exists. **/
>
> @@ -963,7 +963,9 @@
> /** The directory exists, but is it a valid working copy yet?
> Try step 2: checking that SVN_WC__ADM_README exists. **/
>
> - err = svn_wc__open_adm_file (&f, path, SVN_WC__ADM_README, APR_READ, pool);
> + err = svn_io_stat (&finfo, svn_path_join (tmp_path, SVN_WC__ADM_README, pool),
> + APR_FINFO_MIN, pool);
> +
> if (err && !APR_STATUS_IS_EEXIST(err->apr_err))
> return err;
> else if (err)
> @@ -973,8 +975,6 @@
> }
> else
> wc_exists = TRUE;
> -
> - SVN_ERR (svn_wc__close_adm_file (f, path, SVN_WC__ADM_README, 0, pool));
>
> /** Step 3: now check that repos and ancestry are correct **/
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon Aug 12 18:41:01 2002

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.