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

[PATCH] Fix for issue 3620 - resolved command

From: Noorul Islam K M <noorul_at_collab.net>
Date: Wed, 03 Nov 2010 22:32:12 +0530

Log

[[[

Make 'svn resolved' verify that none of its targets are URLs.

* subversion/svn/resolved-cmd.c
  (svn_cl__resolved): Raise an error if any targets look like URLs.

* subversion/tests/cmdline/input_validation_tests.py
  (invalid_resolved_targets, test_list): New test.

Patch by: Noorul Islam K M <noorul{_AT_}collab.net>

]]]

Thanks and Regards
Noorul

Index: subversion/tests/cmdline/input_validation_tests.py
===================================================================
--- subversion/tests/cmdline/input_validation_tests.py (revision 1030477)
+++ subversion/tests/cmdline/input_validation_tests.py (working copy)
@@ -173,6 +173,12 @@
     run_and_verify_svn_in_wc(sbox, "svn:.*is not a local path", 'upgrade',
                              target, target)
 
+def invalid_resolved_targets(sbox):
+ "non-working copy paths for 'resolved'"
+ sbox.build(read_only=True)
+ for target in _invalid_wc_path_targets:
+ run_and_verify_svn_in_wc(sbox, "svn:.*is not a local path", 'resolved',
+ target)
 
 ########################################################################
 # Run the tests
@@ -192,6 +198,7 @@
               invalid_log_targets,
               invalid_merge_args,
               invalid_wcpath_upgrade,
+ invalid_resolved_targets,
              ]
 
 if __name__ == '__main__':
Index: subversion/svn/resolved-cmd.c
===================================================================
--- subversion/svn/resolved-cmd.c (revision 1030477)
+++ subversion/svn/resolved-cmd.c (working copy)
@@ -29,6 +29,7 @@
 #define APR_WANT_STDIO
 #include <apr_want.h>
 
+#include "svn_path.h"
 #include "svn_client.h"
 #include "svn_error.h"
 #include "svn_pools.h"
@@ -64,13 +65,25 @@
 
   SVN_ERR(svn_cl__eat_peg_revisions(&targets, targets, scratch_pool));
 
+ /* URLs are invalid input. */
+ for (i = 0; i < targets->nelts; i++)
+ {
+ const char *target = APR_ARRAY_IDX(targets, i, const char *);
+
+ if (svn_path_is_url(target))
+ return svn_error_return(svn_error_createf(SVN_ERR_CL_ARG_PARSING_ERROR,
+ NULL,
+ _("'%s' is not a local path"),
+ target));
+ }
+
   iterpool = svn_pool_create(scratch_pool);
   for (i = 0; i < targets->nelts; i++)
     {
       const char *target = APR_ARRAY_IDX(targets, i, const char *);
       svn_pool_clear(iterpool);
       SVN_ERR(svn_cl__check_cancel(ctx->cancel_baton));
- err = svn_client_resolve(target,
+ err = svn_client_resolve(svn_dirent_canonicalize(target, iterpool),
                                opt_state->depth,
                                svn_wc_conflict_choose_merged,
                                ctx,
Received on 2010-11-03 18:03:10 CET

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.