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

[PATCH] Make 'svnadmin rmlocks' fuss when no FS-path is provided

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: 2007-12-11 21:02:47 CET

This bug just frustrated some CollabNet Operations folk who made the wrong
assumption about what 'svnadmin rmlocks' does. I'm providing a patch
because I'm off in a branch doing other things at the moment. I believe
this fix should go into trunk and be backported to 1.4.x.

-- 
C. Michael Pilato <cmpilato@collab.net>
CollabNet   <>   www.collab.net   <>   Distributed Development On Demand

Make 'svnadmin rmlocks' complain if no paths-to-unlock were provided
(as is required by the displayed usage). This should alleviated
future occurrences of folks believing this subcommand will simply
remove all the locks in the repository.

* subversion/svnadmin/main.c
  (subcommand_rmlocks): Throw an error if there were no paths to
    unlock provided.

Index: subversion/svnadmin/main.c
===================================================================
--- subversion/svnadmin/main.c (revision 28402)
+++ subversion/svnadmin/main.c (working copy)
@@ -1191,7 +1191,12 @@
   /* Parse out any options. */
   SVN_ERR(svn_opt_parse_all_args(&args, os, pool));
 
- /* All the rest of the arguments are lock names. */
+ /* Our usage requires at least one FS path. */
+ if (args->nelts == 0)
+ return svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, 0,
+ _("No paths to unlock provided"));
+
+ /* All the rest of the arguments are paths from which to remove locks. */
   for (i = 0; i < args->nelts; i++)
     {
       const char *lock_path = APR_ARRAY_IDX(args, i, const char *);

Received on Tue Dec 11 21:03:09 2007

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.