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,
==========================================================
»«¤h«eº®u³]p®v¢w ¶ø§Q¦ò.¥¬¹p¡A³Ì·s¤O§@
http://edm-prg.epaper.com.tw/click.php?ad_code=7746
==========================================================
PChomeÁʪ«¡G¥xÆW²Ä¤@ªºÁʪ«ºô¯¸¡I
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