php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #58277 svn_export should have parameter revision
Submitted: 2008-07-16 21:42 UTC Modified: 2010-02-07 23:51 UTC
From: bjoern at xrow dot de Assigned:
Status: Closed Package: svn (PECL)
PHP Version: 5.2.5 OS: whatever
Private report: No CVE-ID: None
 [2008-07-16 21:42 UTC] bjoern at xrow dot de
Description:
------------
Hi,

it could be quite handy if svn_export has parameter revision.

svn_export(string frompath, string topath[, revision][, bool working_copy = true])

Reproduce code:
---------------
na

Expected result:
----------------
na

Actual result:
--------------
na

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-02-05 17:45 UTC] lostoutfrog at yahoo dot co dot uk
If I'm not mistaken, we could have something like (I just copied the part that would change):
/* {{{ proto resource svn_export(string frompath, string topath [, int revision = SVN_REVISION_HEAD[, bool working_copy = true]])
	Export the contents of either a working copy or repository into a 'clean' directory.
	If working_copy is true it will export uncommitted files from a working copy. */
PHP_FUNCTION(svn_export)
{
	const char *from = NULL, *to = NULL;
	const char *utf8_from_path = NULL, *utf8_to_path = NULL;
	int fromlen, tolen, rev;
	apr_pool_t *subpool;
	zend_bool working_copy = 1;
	svn_error_t *err;
	svn_opt_revision_t revision, peg_revision;

	if (FAILURE == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|lb",
				&from, &fromlen, &to, &tolen, &rev, &working_copy)) {
		return;
	}
...
if (working_copy) {
		peg_revision.kind = svn_opt_revision_working;
	} else {
		peg_revision.kind = svn_opt_revision_head;
	}
	
	peg_revision.kind = svn_opt_revision_unspecified;
	
	revision.kind = svn_opt_revision_number;
	revision.value = rev;

	err = svn_client_export3(NULL, from, to, &peg_revision, &revision, TRUE, FALSE, TRUE, NULL, SVN_G(ctx), subpool);
...
}
I can't do the built to validate that but I'm fairly confident.
If one of you guys could include that in the next release, it'd be great since I could use that then :)
 [2010-02-07 23:51 UTC] alan at akbkhome dot com
This bug has been fixed in SVN.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

Could you check the version in svn
http://svn.php.net/repository/pecl/svn/trunk/

The location of the 'rev' has to be at the end to prevent 
Backward compatibility breaks.
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Tue Jul 16 15:01:26 2019 UTC