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

Re: [patch] [Issue 566] Import fails on Win32 due to APR bug/problem

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2001-12-17 23:59:53 CET

Thanks Barry, applied the patch as revision 659.

When you get a chance, read over the section "Writing log entries" in
HACKING. The main thing is the importance of including the names of
the functions changed. There are some examples there.

By the way, it's not clear to me whether this behavior of
APR_FINFO_NORM on Win32 is a bug or not. I'm inclined to think it is;
the comments next to APR_FINFO_NORM in apr_file_info.h are sort of
unix-specific, but I think they're descriptive not prescriptive. One
ought to be able to use APR_FINFO_NORM on Windows, after all. :-)

Your fix below is the right one for Subversion, but you might want to
consider patching APR too. Many people here are APR committers, so
we'll see your patch when it pops up on the APR list.

-Karl

> This patch fixes a problem that keeps svn "import" from working Win32.
>
> When apr_read_dir() is called with APR_FINFO_NORM as its "wanted" flag,
> APR on a Win32 box returns APR_INCOMPLETE, instead of APR_SUCCESS because
> the APR_FINFO_NORM bitmask includes bits indicating you want dev and inode
> info, and those aren't available on the Win32 platform.
>
> With this patch, Subversion's libsvn_client/add.c and
> libsvn_client/commit.c only
> ask for name and type info, which is all they really need, it should
> work for all
> platforms, and is consistent with how apr_read_dir() is called in
> libsvn_subr/io.c
>
> Barry
> Index: .\subversion\libsvn_client\add.c
> ===================================================================
> --- .\subversion\libsvn_client\.svn\text-base\add.c.svn-base Tue Nov 27 15:35:50 2001
> +++ .\subversion\libsvn_client\add.c Tue Nov 27 15:42:17 2001
> @@ -43,6 +43,7 @@
> apr_finfo_t this_entry;
> apr_status_t apr_err;
> apr_pool_t *subpool;
> + apr_int32_t flags = APR_FINFO_TYPE | APR_FINFO_NAME;
>
> /* Add this directory to revision control. */
> SVN_ERR (svn_wc_add_directory (svn_stringbuf_create (dirname, pool),
> @@ -55,9 +56,9 @@
> /* Read the directory entries one by one and add those things to
> revision control. */
> apr_err = apr_dir_open (&dir, dirname, pool);
> - for (apr_err = apr_dir_read (&this_entry, APR_FINFO_NORM, dir);
> + for (apr_err = apr_dir_read (&this_entry, flags, dir);
> APR_STATUS_IS_SUCCESS (apr_err);
> - apr_err = apr_dir_read (&this_entry, APR_FINFO_NORM, dir))
> + apr_err = apr_dir_read (&this_entry, flags, dir))
> {
> svn_stringbuf_t *fullpath;
>
> Index: .\subversion\libsvn_client\commit.c
> ===================================================================
> --- .\subversion\libsvn_client\.svn\text-base\commit.c.svn-base Sun Nov 25 21:21:25 2001
> +++ .\subversion\libsvn_client\commit.c Tue Nov 27 15:42:37 2001
> @@ -155,11 +155,12 @@
> apr_dir_t *dir;
> apr_finfo_t this_entry;
> apr_status_t apr_err;
> + apr_int32_t flags = APR_FINFO_TYPE | APR_FINFO_NAME;
>
> apr_err = apr_dir_open (&dir, path->data, subpool);
> - for (apr_err = apr_dir_read (&this_entry, APR_FINFO_NORM, dir);
> + for (apr_err = apr_dir_read (&this_entry, flags, dir);
> APR_STATUS_IS_SUCCESS (apr_err);
> - apr_err = apr_dir_read (&this_entry, APR_FINFO_NORM, dir))
> + apr_err = apr_dir_read (&this_entry, flags, dir))
> {
> svn_stringbuf_t *new_path = svn_stringbuf_dup (path, subpool);
> svn_path_add_component (new_path,
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-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 Sat Oct 21 14:36:53 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.