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

Re: set svn:keywords property on svn add

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2003-02-10 20:16:36 CET

Olaf Hering <olh@suse.de> writes:
> I added a (global) svn:keyword on 'svn add foo.c' with the patch below.
>
> ~/.subversion/config:
> [properties_on_add]
> keywords = foo bar Id HostURL
>
> However, it would make more sense to specify that per repository. The
> right place for that seems to be ~/subversion/servers.
> I do not see how to retrieve the URL in the add-cmd.c and match it
> against the configured servers.
>
> Is such a change acceptable?

It looks like you are offering the patch as a substitute for a precise
prose description of the change. Please just use prose instead :-).
Then it would be much easier to comprehend, quote, modify, etc, in the
context of a mailing list discussion.

If I understand the proposal correctly, I don't find it very
compelling, not pre-1.0 imho.

(If I'm wrong, and the patch really is meant for application, then see
the HACKING file for guidance. Specifically, the "#ifdef olh"s have
to go :-); it needs a log message; the new function needs to be
documented; the new function should be static, needs no independent
prototype, and needs no "svn_cl__" prefix; etc.)

Best,
-Karl

> --- subversion-0.17.1.orig/subversion/clients/cmdline/add-cmd.c 2003-01-20 22:21:27.000000000 +0100
> +++ subversion-0.17.1/subversion/clients/cmdline/add-cmd.c 2003-02-02 17:11:45.000000000 +0100
> @@ -31,8 +31,24 @@
> #include "svn_delta.h"
> #include "svn_error.h"
> #include "svn_pools.h"
> +#include "svn_config.h"
> #include "cl.h"
>
> +#define olh
> +#ifdef olh
> +svn_error_t * svn_cl__add_keywords(const char *add_keywords, svn_boolean_t recurse, const char *target, apr_pool_t *pool);
> +svn_error_t *
> +svn_cl__add_keywords(const char *add_keywords, svn_boolean_t recurse, const char *target, apr_pool_t *pool)
> +{
> + svn_string_t propval;
> +
> + propval.data = add_keywords;
> + propval.len = strlen(add_keywords);
> +
> + SVN_ERR (svn_client_propset("svn:keywords", &propval, target, recurse, pool));
> + return SVN_NO_ERROR;
> +}
> +#endif
>
>
> /*** Code. ***/
> @@ -50,6 +66,13 @@ svn_cl__add (apr_getopt_t *os,
> apr_pool_t *subpool;
> svn_wc_notify_func_t notify_func = NULL;
> void *notify_baton = NULL;
> +#ifdef olh
> + struct svn_config_t *cfg;
> + const char *add_keywords = NULL;
> +
> + SVN_ERR (svn_config_read_config (&cfg, pool));
> + svn_config_get (cfg, &add_keywords, "properties_on_add", "keywords", add_keywords);
> +#endif
>
> SVN_ERR (svn_opt_args_to_target_array (&targets, os,
> opt_state->targets,
> @@ -81,6 +104,10 @@ svn_cl__add (apr_getopt_t *os,
> else
> return err;
> }
> +#ifdef olh
> + if (add_keywords)
> + svn_cl__add_keywords(add_keywords, ! opt_state->nonrecursive, target, pool);
> +#endif
>
> svn_pool_clear (subpool);
> }
>
> --
> A: No.
> Q: Should I include quotations after my reply?
>
> ---------------------------------------------------------------------
> 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 Mon Feb 10 20:48:09 2003

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.