|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchespach-svn_import (last revision 2011-11-14 11:56 UTC by slungo at 9online dot fr)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2021-09-16 10:16 UTC] cmb@php.net
[2021-09-17 08:18 UTC] alan_k@php.net
[2021-09-17 10:34 UTC] git@php.net
[2021-09-17 10:34 UTC] git@php.net
-Status: Open
+Status: Closed
[2021-09-17 10:36 UTC] cmb@php.net
-Assigned To:
+Assigned To: alan_k
[2021-09-17 10:36 UTC] cmb@php.net
[2021-09-17 10:37 UTC] cmb@php.net
-Summary: svn_import need log meesage
+Summary: svn_import need log message
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 06 17:00:01 2025 UTC |
Description: ------------ The svn_import do nothing when I use it. I saw a bugfix on svn_make that needed also a log message to work, so I try to use the same fix on svn_import, recompiling the source and it worked. I also had to correct the type of the variable nonrecursive from svn_boolean_t to zend_bool to make the recursion work. This is my corrected source code: /* {{{ proto bool svn_import(string path, string url, bool nonrecursive [, string message ]) Imports unversioned path into repository at url */ PHP_FUNCTION(svn_import) { svn_client_commit_info_t *commit_info_p = NULL; const char *path = NULL, *logmsg = NULL; const char *utf8_path = NULL; int pathlen, logmsg_len; char *url; int urllen; zend_bool nonrecursive; svn_error_t *err; apr_pool_t *subpool; if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ssb|s", &path, &pathlen, &url, &urllen, &nonrecursive, &logmsg, &logmsg_len)) { RETURN_FALSE; } PHP_SVN_INIT_CLIENT(); subpool = svn_pool_create(SVN_G(pool)); if (!subpool) { RETURN_FALSE; } svn_utf_cstring_to_utf8 (&utf8_path, path, subpool); path = svn_path_canonicalize(utf8_path, subpool); SVN_G(ctx)->log_msg_baton = logmsg; err = svn_client_import(&commit_info_p, path, url, nonrecursive, SVN_G(ctx), subpool); SVN_G(ctx)->log_msg_baton = NULL; if (err) { php_svn_handle_error (err TSRMLS_CC); RETVAL_FALSE; } else { RETVAL_TRUE; } svn_pool_destroy(subpool); } Test script: --------------- svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_USERNAME, $login); svn_auth_set_parameter(SVN_AUTH_PARAM_DEFAULT_PASSWORD, $passwd); svn_auth_set_parameter(PHP_SVN_AUTH_PARAM_IGNORE_SSL_VERIFY_ERRORS, true); svn_auth_set_parameter(SVN_AUTH_PARAM_NON_INTERACTIVE, true); svn_auth_set_parameter(SVN_AUTH_PARAM_NO_AUTH_CACHE, true); try { if (false === svn_ls($repo_dest)) { // Import recursively a folder containing files & sub-folders if (false === svn_import($path_src, $repo_dest, false)) throw new Exception("Can't import..."); } } catch (Exception $e) { } Expected result: ---------------- I expect to have the source directory recursively imported to the SVN. Actual result: -------------- Nothing is done. With my first fix (i.e. adding new parameter for log message) only the first level of the source directory content is imported (the recursivity does not work). With my second fix (i.e. changing the type of the variable "nonrecursive") the source directory is completly imported (the recursivity now works).