[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Some commands accept "-r X:Y" but silently ignore the ":Y"

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-06-28 00:56:49 CEST

Several svn commands seem to accept a revision range argument "-r X:Y" even though they can only operate on a single revision.

I distinguish two problems:

1. The commands that take only one revision should fail with an error message if a second revision number is supplied, as they would with any other invalid option. Currently "cat" does this but other commands silently ignore the second revision number.

2. The help text should not show "-r X:Y" when only "-r X" is acceptable. I regard a program's built-in help text as its most authoratitive user documentation so I think it needs to be accurate. Unfortunately the way the options are parsed makes it difficult to give different text for the "-r" option according to which command is being invoked.

Possible fixes:

A. Fix (1) by making all the other commands that take "-r" check that ":Y" was not given, like "cat" does.

B. Fix (2) by rewording the "-r" usage message to indicate that only some commands accept ":Y".

C. Fix both (1) and (2) by rearranging the option parsing so that different commands can have different syntax and usage messages for the same option letter.

D. Fix (1) in main.c by testing for specific commands, like:

  if (cmd=="diff" || cmd=="log" || cmd=="merge")
   { accept any "-r" option }
  else
   { exit with an error if a second revision ":Y" was given }

A similar type of check is already done there to check the log message options for the commit-causing commands.

I am presently in favour of B and D.

Comments?

These cannot take "-r":
  add cleanup commit delete help import info mkdir resolve revert status

These should accept only "-r X":
  cat checkout copy export list move propdel propedit propget proplist propset switch update

These can accept "-r X[:Y]":
  diff log merge

- Julian

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sat Jun 28 00:50:44 2003

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.