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

patch to libsvn_client/export.c

From: plasma <plasmaball_at_pchome.com.tw>
Date: 2003-05-17 03:10:31 CEST

hi all,

  'svn export' refuses to export source files into an existing
directory. Say, if I ran a 'svn export URL PATH', found I made a
mistake (maybe forget to commit a file, or export a wrong branch),
then rerun 'svn export URL2 PATH'. Because the PATH was created by
previous command, the second one will refuse to run. PATH should be
removed explicity by user, and I think it's annoying.

  The following patch will make svn exports source files into an
existing directory. It only barks if the existing target is a file,
instead of a directory.

plasma

LOG:

Make svn exports source files into an existing directory.

PATCH:

--- subversion/libsvn_client/export.c.orig Sat May 10 09:05:54 2003
+++ subversion/libsvn_client/export.c Fri May 16 23:35:10 2003
@@ -305,11 +305,12 @@
   svn_node_kind_t kind;
   
   SVN_ERR (svn_io_check_path (eb->root_path, &kind, pool));
- if (kind != svn_node_none)
+ 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);
 
- SVN_ERR (svn_io_dir_make (eb->root_path, APR_OS_DEFAULT, pool));
 
   if (eb->notify_func)
     (*eb->notify_func) (eb->notify_baton,
@@ -338,8 +339,14 @@
   struct edit_baton *eb = parent_baton;
   const char *full_path = svn_path_join (eb->root_path,
                                          path, pool);
+ svn_node_kind_t kind;
 
- SVN_ERR (svn_io_dir_make (full_path, APR_OS_DEFAULT, pool));
+ SVN_ERR (svn_io_check_path (full_path, &kind, pool));
+ if (kind == svn_node_none)
+ SVN_ERR (svn_io_dir_make (full_path, APR_OS_DEFAULT, pool));
+ else if (kind == svn_node_file)
+ return svn_error_create (SVN_ERR_WC_OBSTRUCTED_UPDATE,
+ NULL, eb->root_path);
 
   if (eb->notify_func)
     (*eb->notify_func) (eb->notify_baton,

==========================================================
 賓士前首席設計師─ 奧利佛.布雷,最新力@
 http://edm-prg.epaper.com.tw/click.php?ad_code=7746
==========================================================
 PChome購物:台灣第@的購物網站!
 http://shopping.pchome.com.tw/
==========================================================

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