php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #57607 [PATCH NEEDED] Add support for switches
Submitted: 2007-04-04 23:31 UTC Modified: 2011-05-31 22:32 UTC
From: edwardzyang at thewritingpot dot com Assigned:
Status: Verified Package: svn (PECL)
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2007-04-04 23:31 UTC] edwardzyang at thewritingpot dot com
Description:
------------
Support for some/all of the switches that the usual SVN executable supports would be highly appreciated. A concrete example of where this would be useful is the svn_log() function: currently it's an all-or-nothing proposition, returning every log message in all the history of the item, or returning a single log message from a single revision. The ability to use the --limit NUM switch is not only helpful: it's necessary! Otherwise, the function is extremely inefficient and, for items with revisions in the thousands, useless.

See http://svnbook.red-bean.com/en/1.2/svn.ref.html#svn.ref.svn.sw for documentation on the switches. Not all switches are supported by all functions.

Because each action supports so many switches, I think that passing them in as an array would be most suitable. More information is detailed below.

This probably requires a lot of effort, judging from the current source code, it doesn't look like the SVN libraries natively support these switches. You may want to prioritize based on the "must have" switches versus the "ah, they can wait" switches. I can provide a list, if you want, of what I consider to be "must have" switches, but you should probably use your judgment, as you'd be the one writing the code (sorry, for me, C is read-only).

Reproduce code:
---------------
Here's a possible use-case:

$logs = svn_log(
  'http://www.example.com/svnroot',
  -2, // we want all revisions...
  array(
    'limit' => 10, // ...but only the first ten...
    'stop-on-copy' => true // ...and don't go too deep!
  )
);


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-02-26 10:57 UTC] scottmac@php.net
Part of the problem is that the extension is using older APIs before the flag was added.

I'm slowly moving things up to 1.4 which will make the transition slightly easier.

If you have a list of switches that would be nice to have I'll make them a priority.
 [2008-03-02 22:36 UTC] alan at akbkhome dot com
this is supported in the lastest release
 proto array svn_log(string repos_url[, int start_revision =  Svn::HEAD, [, int end_revision = Svn::INITIAL [, int limit [, int flags ]]]])

flags can be:SVN_OMIT_MESSAGES, SVN_DISCOVER_CHANGED_PATHS, SVN_STOP_ON_COPY
 [2008-03-04 19:45 UTC] scottmac@php.net
There are more than just svn_log that have new flags added. I 
can see a few in svn_commit and other places.
 [2008-03-12 18:13 UTC] pecl at xaospage dot de
SVN_OMIT_MESSAGES is default with 0.30 "4", i have no idea what does it mean..is there any documentation about the constants?

xaos
 [2011-05-31 22:32 UTC] alan at akbkhome dot com
svn_commit can be changed - patch or commit needed
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Wed Jul 17 08:01:26 2019 UTC