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

More miscellaneous bugs and wishes

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-10-23 02:53:27 CEST

For comments:

We said that "svn propset" should restrict the property name character set to valid XML tag characters or so. What set of characters?

"svn copy . ../newdir" fails with an inappropriate error message:
  ~/tmp/svn-sandbox/sail/TM> svn cp . ../TM2
  /home/julianfoad/src/subversion/subversion/libsvn_client/copy.c:990: (apr_err=200007)
  svn: Trying to use an unsupported feature
  svn: cannot copy path '' into its own child '../TM2'

"svn list dir/" should prepend "dir/" to the output, and/or prefix each block of output with a "dir:" line, so that output with multiple targets makes sense.

Commands like "list" and "proplist" should treat unversioned files in the same way. Presently "list" aborts but "proplist" warns and continues.

subversion/libsvn_subr/io.c: svn_io_make_dir_recursively should move into apr_dir_make_recursive, currently only implemented for UNIX and Win32.

"status foo", in a WC, gives no output if "foo" is neither versioned nor on disk. This is misleading: no output implies up-to-date.

"svn status ../.." segfaults if ".." is a WC but "../.." is not. svn_client_status should never set target="..".

"svn diff": revision numbers shown often differ from those specified. "wc" is shown instead of "base", "0" instead of "1", etc.

"svn diff -rBASE:1 file" says "(rev 1):(working copy)" which is backwards and wrong, whereas "diff -r1:BASE" says "(rev 0):(rev 38)" which is better. "file" was created at r34, modified at r35, currently updated to r38. "-rX:Y" and "-rY:X" should be symmetric.

"svn diff" has other flaws which are exposed by my new test number 20 in diff_tests.py, added in r7491.

HELP AND ERROR MESSAGES

Several svn commands accept a single revision argument ("-r X") but not a revision range ("-r X:Y"). The usage message is always the same, and indicates that a range is allowed. Only "cat" actually checks that a second revision number has not been supplied. The other commands silently ignore any second revision number that is supplied. Patch attached.

Help text says "-r X:Y" in some places but "-r N:M" or "-r M:N" in others. Propose to say "X:Y" everywhere.

Help for --file and --encoding doesn't say what data the option applies to. They apply to the commit message for most commands but the property value for "propset".

When a bad option is given (recognised but inappropriate), svn displays a suitable error message followed by help. As the help is sometimes long, the error can be lost off the screen. No need for the help; it should just give the error or perhaps say how to get help, like it does for unrecognised options.
  ~/tmp/svn-sandbox/issue777> svn diff -i
  lt-svn: invalid option character: i
  Type `svn help' for usage.
  ~/tmp/svn-sandbox/issue777> svn diff -q

  Error: subcommand 'diff' doesn't accept option '-q [--quiet]'

  diff (di): display the differences between two paths.
  usage: 1. diff [-r N[:M]] [--old OLD-TGT] [--new NEW-TGT] [PATH...]
  [...]

Index: subversion/clients/cmdline/cat-cmd.c
===================================================================
--- subversion/clients/cmdline/cat-cmd.c (revision 7481)
+++ subversion/clients/cmdline/cat-cmd.c (working copy)
@@ -44,10 +44,6 @@
   svn_stream_t *out;
   apr_pool_t *subpool = svn_pool_create (pool);
 
- if (opt_state->end_revision.kind != svn_opt_revision_unspecified)
- return svn_error_createf (SVN_ERR_CLIENT_REVISION_RANGE, NULL,
- "cat only accepts a single revision");
-
   SVN_ERR (svn_opt_args_to_target_array (&targets, os,
                                          opt_state->targets,
                                          &(opt_state->start_revision),
Index: subversion/clients/cmdline/main.c
===================================================================
--- subversion/clients/cmdline/main.c (revision 7481)
+++ subversion/clients/cmdline/main.c (working copy)
@@ -69,7 +69,8 @@
     {"non-recursive", 'N', 0, "operate on single directory only"},
     {"revision", 'r', 1,
                   "revision X or X:Y range. X or Y can be one of:\n"
- " {DATE} date instead of revision number\n"
+ " NUMBER revision number\n"
+ " {DATE} last revision before date\n"
      " \"HEAD\" latest in repository\n"
      " \"BASE\" base revision of item's working copy\n"
      " \"COMMITTED\" revision of item's last commit\n"
@@ -1018,6 +1019,23 @@
         }
     }
 
+ /* Only a few commands can accept a revision range; the rest can take at
+ most one revision number. */
+ if (subcommand->cmd_func != svn_cl__diff
+ && subcommand->cmd_func != svn_cl__log
+ && subcommand->cmd_func != svn_cl__merge)
+ {
+ if (opt_state.end_revision.kind != svn_opt_revision_unspecified)
+ {
+ svn_handle_error
+ (svn_error_create (SVN_ERR_CLIENT_REVISION_RANGE, NULL,
+ "this command only accepts a single revision"),
+ stderr, FALSE);
+ svn_pool_destroy (pool);
+ return EXIT_FAILURE;
+ }
+ }
+
   /* Create a client context object. */
   command_baton.opt_state = &opt_state;
   command_baton.ctx = &ctx;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Thu Oct 23 02:52:20 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.