You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by st...@apache.org on 2010/11/17 14:52:22 UTC
svn commit: r1036037 - /subversion/trunk/subversion/svn/main.c
Author: stsp
Date: Wed Nov 17 13:52:21 2010
New Revision: 1036037
URL: http://svn.apache.org/viewvc?rev=1036037&view=rev
Log:
* subversion/svn/main.c
(main): Remove TODO question in comment.
The question was:
TODO: Any reason we're not just using opt.c's
revision-parsing code here? Then -c could take
"{DATE}" and the special words.
My answer is:
To calculate the range -rN:M corresponding to -c {DATE}, -c BASE,
or -c HEAD, we'd need to call svn_client__get_revision_number(),
which needs a working copy context and abspath, and an RA session.
But we don't have any of that while parsing options. So the opt.c
parsing code doesn't provide additional value here.
I did in fact attempt to write a patch to use the opt.c code just for
parsing the revision number. But that turned out to be larger than
the existing in-line parser because the opt.c parsing code doesn't
handle all possible -c arguments (e.g. negative revision numbers).
The API is pretty awkward to use for -c. The existing code is nicer.
Modified:
subversion/trunk/subversion/svn/main.c
Modified: subversion/trunk/subversion/svn/main.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/svn/main.c?rev=1036037&r1=1036036&r2=1036037&view=diff
==============================================================================
--- subversion/trunk/subversion/svn/main.c (original)
+++ subversion/trunk/subversion/svn/main.c Wed Nov 17 13:52:21 2010
@@ -1398,10 +1398,7 @@ main(int argc, const char *argv[])
if (is_negative)
s++;
- /* Allow any number of 'r's to prefix a revision number.
- ### TODO: Any reason we're not just using opt.c's
- ### revision-parsing code here? Then -c could take
- ### "{DATE}" and the special words. */
+ /* Allow any number of 'r's to prefix a revision number. */
while (*s == 'r')
s++;
changeno = changeno_end = strtol(s, &end, 10);