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

Re: [PATCH] Issue #2105 - Add "--no-ignore" option to 'svn add' and 'svn import'

From: Peter N. Lundblad <peter_at_famlundblad.se>
Date: 2005-05-19 15:37:07 CEST

On Wed, 18 May 2005, S.Ramaswamy wrote:

> Log:
>
> Fix issue #2105. Add "--no-ignore" switch to 'svn import' and 'svn add'
>

Just style and comment nits.

> Index: subversion/include/svn_client.h
> ===================================================================
> --- subversion/include/svn_client.h (revision 14771)
> +++ subversion/include/svn_client.h (working copy)
> @@ -630,11 +630,28 @@
> * @a ctx->notify_func2 with @a ctx->notify_baton2 and the path of the
> * added item.
> *
> + * Use @a no_ignore to indicate that files and directories that match
> + * ignore patterns should be added.
> + *
> * Important: this is a *scheduling* operation. No changes will
> * happen to the repository until a commit occurs. This scheduling
> * can be removed with svn_client_revert().
> */
> svn_error_t *
> +svn_client_add3 (const char *path,
> + svn_boolean_t recursive,
> + svn_boolean_t force,
> + svn_boolean_t no_ignore,
> + svn_client_ctx_t *ctx,
> + apr_pool_t *pool);
> +

when you add a new API, don't forget to add a line like the following:
@since New in 1.3.

It shouldn't occur first in the docstring, since then it will be
treated as the short function description by doxygen. (We did it that
way before an no one has done the ceeanup yet.)

> +/**
> + * @deprecated Provided for backward compatibility with the 1.2 API.
> + *
> + * Similar to svn_client_add3(), but with the @a no_ignore parameter
> + * always set to @c FALSE.
> + */

Same for @deprecated.

> +svn_error_t *
> svn_client_add2 (const char *path,
> svn_boolean_t recursive,
> svn_boolean_t force,
> @@ -744,6 +761,9 @@
> * Use @a nonrecursive to indicate that imported directories should not
> * recurse into any subdirectories they may have.
> *
> + * Use @a no_ignore to indicate that files and directories that match
> + * ignore patterns should be imported.
> + *
> * ### kff todo: This import is similar to cvs import, in that it does
> * not change the source tree into a working copy. However, this
> * behavior confuses most people, and I think eventually svn _should_
> @@ -751,6 +771,20 @@
> * option. However, doing so is a bit involved, and we don't need it
> * right now.
> */

Missing @since.

> +svn_error_t *svn_client_import2 (svn_client_commit_info_t **commit_info,
> + const char *path,
> + const char *url,
> + svn_boolean_t nonrecursive,
> + svn_boolean_t no_ignore,
> + svn_client_ctx_t *ctx,
> + apr_pool_t *pool);
> +
> +/**
> + * @deprecated Provided for backward compatibility with the 1.2 API.
> + *
> + * Similar to svn_client_import except for @a no_ignore set to FALSE
> + * always.
> + */

Misplaced @deprecated.

> svn_error_t *svn_client_import (svn_client_commit_info_t **commit_info,
> const char *path,
> const char *url,
> @@ -758,7 +792,6 @@
> svn_client_ctx_t *ctx,
> apr_pool_t *pool);
>
> -
> /** @since New in 1.2.
> *
> * Commit files or directories into repository, authenticating with

> @@ -322,8 +324,11 @@
> || (this_entry.name[1] == '.' && this_entry.name[2] == '\0')))
> continue;
>
> - if (svn_cstring_match_glob_list (this_entry.name, ignores))
> - continue;
> + if (!no_ignore)
> + {
> + if (svn_cstring_match_glob_list (this_entry.name, ignores))
> + continue;
> + }
>

this could be written more compactly with just one if statement (but
it is mostly a matte of taste).

> @@ -364,8 +366,11 @@
> if (apr_hash_get (excludes, abs_path, APR_HASH_KEY_STRING))
> continue;
>
> - if (svn_cstring_match_glob_list (filename, ignores))
> - continue;
> + if (!no_ignore)
> + {
> + if (svn_cstring_match_glob_list (filename, ignores))
> + continue;
> + }
>

Same nit here.

> /* We only import subdirectories when we're doing a regular
> recursive import. */
> @@ -441,9 +447,6 @@
> * If CTX->NOTIFY_FUNC is non-null, invoke it with CTX->NOTIFY_BATON for
> * each imported path, passing actions svn_wc_notify_commit_added.
> *
> - * EXCLUDES is a hash whose keys are absolute paths to exclude from
> - * the import (values are unused).
> - *

why did you drop these lines?

Else it looks good to me. Would you write a test case for this?

Thanks,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu May 19 15:28:44 2005

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