|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-09-07 06:00 UTC] tyra3l at gmail dot com
Description:
------------
One couldn't use the svn_info for a checkout without providing
valid authentication data.
I don't see any reason, why would the user/pass required for a
simple svn info.
the returned result doesn't provide any data which isn't
available from the local svn files.
Reproduce code:
---------------
<?php
$result = svn_info('/var/www/some_checkout/', false);
print_r($result);
Expected result:
----------------
Array
(
[0] => Array
(
[path]
...
Actual result:
--------------
Warning: svn_info(): svn error(s) occured
170001 (Authorization failed) OPTIONS of '...': authorization
failed (http://...) in test.php on line 2
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 14:00:01 2025 UTC |
Try this change, then svn_info('/var/www/some_checkout/', false, -5); --- svn.c (revision 303132) +++ svn.c (working copy) @@ -2002,7 +2002,9 @@ array_init(return_value); revision.value.number = revnum; - revision.kind = php_svn_get_revision_kind(revision); + revision.kind = !svn_path_is_url(path) && revnum < -4 ? + svn_opt_revision_unspecified : php_svn_get_revision_kind(revision); + peg_revision.kind = svn_path_is_url(path)? svn_opt_revision_head: svn_opt_revision_unspecified;This is the notes from the C API. - basically the revision needs to be set as UNSPECIFIED for local info to work. * If both revision arguments are either @c * svn_opt_revision_unspecified or NULL, then information will be * pulled solely from the working copy; no network connections will be * made. The php api now accepts this. svn_info('/var/www/some_checkout/', false, SVN_REVISION_UNSPECIFIED);the SVN_REVISION_UNSPECIFIED seems good, if I can use NULL for this behavior, thats even better, because this reflects the default behavior of the cli svn client ("svn info" without specified revision number works offline, with specified revision number, its not). thanks for the fix. Tyrael