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

Re: [rfc/patch] Fix issue 734, import should 'mkdir -p'

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2003-05-03 18:03:30 CEST

On Saturday, May 3, 2003, at 11:50 AM, David Kimdon wrote:

> On Fri, May 02, 2003 at 07:47:09AM -0500, cmpilato@collab.net wrote:
>> Unfortunately, that's not quite right. The rules of editor driving
>> require that you keep all the intermediate directories open, closing
>
> k, thanks for the tip, here is an update. Do we like it?

i'll let cmpilato comment on the implementation itself, but one thing i
noticed...

> + if (new_entry) {
> + apr_array_header_t *dirs;
> + const char *new_path = "";
> + int i;
> +
> + dirs = svn_path_decompose (new_entry, pool);
> +
> + /* If we are importing a file then NEW_ENTRY's basename is
> + * the desired filename in the repository. (We don't create
> + * a directory with that name.) Discard the component. */
> + if (kind == svn_node_file) {
> + apr_array_pop (dirs);
> + }
> +
> + for (i = 0; i < dirs->nelts; i++) {
> +
> + if (new_dir_baton) {
> +
> + if (!batons) {
> + batons = apr_array_make (pool, 1, sizeof (void *));
> + }
> +
> + *((void **) apr_array_push (batons)) = new_dir_baton;
> +
> + }
> + new_path = svn_path_join (new_path, ((char
> **)dirs->elts)[i],
> + pool);
> +
> + SVN_ERR (editor->add_directory (new_path, root_baton,
> + NULL, SVN_INVALID_REVNUM,
> + pool, &new_dir_baton));
> + }
> + }

the indentation here (and in the rest of the patch) is kind of off. we
use the gnu style, so it should be something like:

for (i = 0; i < blargh; ++i)
   {
     if (blah)
       {
         foo ();
       }
     else
       {
         bar ();
       }
   }

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat May 3 18:04:15 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.