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

Re: patch to libsvn_client/export.c

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2003-05-19 01:44:17 CEST

plasma <plasmaball@pchome.com.tw> writes:

> LOG:
>
> Issue #1296. Add a new --force option to 'svn export'.

Please read the HACKING file or run
 'svn log http://svn.collab.net/repos/svn'
to see the preferred format for log messages,

> --- subversion/libsvn_client/export.c.orig Sat May 10 09:05:54 2003
> +++ subversion/libsvn_client/export.c Sun May 18 14:00:09 2003
[...]
> @@ -305,11 +307,22 @@
> svn_node_kind_t kind;
>
> SVN_ERR (svn_io_check_path (eb->root_path, &kind, pool));
> - if (kind != svn_node_none)
> - return svn_error_create (SVN_ERR_WC_OBSTRUCTED_UPDATE,
> - NULL, eb->root_path);
> + if (eb->force)
> + {
> + if (kind == svn_node_none)
> + SVN_ERR (svn_io_dir_make (eb->root_path, APR_OS_DEFAULT, pool));
> + else if (kind == svn_node_file)
> + return svn_error_create (SVN_ERR_WC_OBSTRUCTED_UPDATE,
> + NULL, eb->root_path);
> + }
> + else
> + {
> + if (kind != svn_node_none)
> + return svn_error_create (SVN_ERR_WC_OBSTRUCTED_UPDATE,
> + NULL, eb->root_path);
> + SVN_ERR (svn_io_dir_make (eb->root_path, APR_OS_DEFAULT, pool));
> + }

Too much code, I'd prefer something like

     if (kind == svn_node_none)
       SVN_ERR (svn_io_dir_make ( ... ));
     else if (! (kind == svn_node_dir && force))
       return svn_error_create ( ... );

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Mon May 19 01:45:13 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.