Author: julianfoad
Date: Fri Jul 17 16:09:37 2015
New Revision: 1691600

URL: http://svn.apache.org/r1691600
Log:
On the 'move-tracking-2' branch: Tweak parsing of the branch-id command-line
option, even though top-level branches other than zero do not work yet.

* subversion/svnmover/svnmover.c
  (sub_main): For the -B/--branch-id option, simplify and tighten parsing and
    improve the error message. No longer accept the -b/--branch option, as
    it was obsolete.

Modified:
    subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c

Modified: subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c?rev=1691600&r1=1691599&r2=1691600&view=diff
==============================================================================
--- subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c 
(original)
+++ subversion/branches/move-tracking-2/subversion/svnmover/svnmover.c Fri Jul 
17 16:09:37 2015
@@ -3350,7 +3350,6 @@ sub_main(int *exit_code, int argc, const
   static const apr_getopt_option_t options[] = {
     {"verbose", 'v', 0, ""},
     {"quiet", 'q', 0, ""},
-    {"branch", 'b', 1, ""},
     {"message", 'm', 1, ""},
     {"file", 'F', 1, ""},
     {"username", 'u', 1, ""},
@@ -3649,14 +3648,8 @@ sub_main(int *exit_code, int argc, const
      ### TODO: Select a nested branch too, from the given id. */
   if (branch_id)
     {
-      int n;
-
-      n = sscanf(branch_id, "B%d", &top_branch_num);
-      printf("'%s' %d %d\n", branch_id, n, top_branch_num);
-      if (n != 1)
-        return svn_error_createf(SVN_ERR_INCORRECT_PARAMS, NULL,
-                                 _("invalid branch spec: '%s'"),
-                                 branch_id);
+      SVN_ERR_W(svn_cstring_atoi(&top_branch_num, branch_id),
+                _("Argument to the -B [--branch-id] option must be an 
integer"));
     }
 
   SVN_ERR(wc_create(&wc,


Reply via email to