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

[PATCH] Allow revert --recursive to have implict dot-target

From: Justin Erenkrantz <jerenkrantz_at_apache.org>
Date: 2002-07-10 22:09:40 CEST

I know cmpilato isn't a fan of this, but I'm going to post this
for completeness-sake. If it goes in, yea. If not, it is here for
all to use even if cmpilato vetoes it. -- justin

Index: ./subversion/clients/cmdline/revert-cmd.c
===================================================================
--- ./subversion/clients/cmdline/revert-cmd.c
+++ ./subversion/clients/cmdline/revert-cmd.c 2002-07-10 12:58:17.000000000 -0700
@@ -48,9 +48,17 @@
   SVN_ERR (svn_cl__args_to_target_array (&targets, os, opt_state,
                                          FALSE, pool));
 
- /* Revert has no implicit dot-target `.', so don't you put that code here! */
   if (! targets->nelts)
- return svn_error_create (SVN_ERR_CL_ARG_PARSING_ERROR, 0, 0, pool, "");
+ {
+ if (! recursive)
+ {
+ return svn_error_create (SVN_ERR_CL_ARG_PARSING_ERROR, 0, 0, pool,
+ "");
+ }
+
+ /* Do add "." if user passed 0 arguments and we are recursive. */
+ svn_cl__push_implicit_dot_target (targets, pool);
+ }
 
   if (! opt_state->quiet)
     svn_cl__get_notifier (&notify_func, &notify_baton, FALSE, FALSE, pool);
Index: ./subversion/clients/cmdline/main.c
===================================================================
--- ./subversion/clients/cmdline/main.c
+++ ./subversion/clients/cmdline/main.c 2002-07-10 12:26:03.000000000 -0700
@@ -304,7 +304,10 @@
   
   { "revert", svn_cl__revert, {0},
     "Restore pristine working copy file (undo all local edits)\n"
- "usage: revert TARGET1 [TARGET2 [TARGET3 ... ]]\n\n"
+ "usage: revert TARGET1 [TARGET2 [TARGET3 ... ]]\n"
+ " Unless --recursive is passed, revert does not have an implicit\n"
+ " target. Therefore, you must explicitly specify any targets\n"
+ " (such as `.').\n\n"
     " Note: this routine does not require network access, and \n"
     " resolves any conflicted states.\n",
     {svn_cl__targets_opt, svn_cl__recursive_opt} },

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Jul 10 22:10:14 2002

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.