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

[PATCH] Limit 'svn propget --strict' to a single non-recursive target

From: C. Michael Pilato <cmpilato_at_collab.net>
Date: Thu, 14 Aug 2008 11:18:53 -0400

I've long regretted that, when I added support for --strict to 'svn
propget', I left the door open for it to be used in recursive propgets or
otherwise multi-target ones. Why anybody would do this is beyond me,
because the resulting output is a stream of concatenated byte-for-byte
property values collected from multiple unidentifiable sources. Completely
useless for most purposes.

So, inspired by Julian's work to revamp the propget output, I'd like to take
this opportunity to undo what I did wrong long ago.

{{{
Limit 'svn propget --strict' to a single target. The multi-target
thing was a mistake resulting often in completely ambiguous output. This
does *not* change the output at all for the common case, where someone
is using 'svn propget --strict' to fetch a specific target's value as
a binary stream sans-beautification.

* subversion/svn/propget-cmd.c
   (svn_cl__propget): Limit the use of --strict to a single target in a
     non-recursive propget.

* subversion/svn/main.c
   (svn_cl__cmd_table): Note this limitation.
}}}

Yes, this would remove "functionality" (and I use that term suspiciously)
that exists in the client. That's why I'm not just committing it outright
-- here's your chance to object on compatability grounds, if you wish. But
I think this is an improvement worth having.

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

Limit 'svn propget --strict' to a single target. The multi-target
thing was a mistake resulting often in completely ambiguous output. This
does *not* change the output at all for the common case, where someone
is using 'svn propget --strict' to fetch a specific target's value as
a binary stream sans-beautification.

* subversion/svn/propget-cmd.c
  (svn_cl__propget): Limit the use of --strict to a single target in a
    non-recursive propget.

* subversion/svn/main.c
  (svn_cl__cmd_table): Note this limitation.

Index: subversion/svn/propget-cmd.c
===================================================================
--- subversion/svn/propget-cmd.c (revision 32461)
+++ subversion/svn/propget-cmd.c (working copy)
@@ -254,6 +254,16 @@
       if (opt_state->depth == svn_depth_unknown)
         opt_state->depth = svn_depth_empty;
 
+ /* Strict mode only makes sense for a single target. So make
+ sure we have only a single target, and that we're not being
+ asked to recurse on that target. */
+ if (opt_state->strict
+ && ((targets->nelts > 1) || (opt_state->depth != svn_depth_empty)))
+ return svn_error_create
+ (SVN_ERR_CL_ARG_PARSING_ERROR, NULL,
+ _("Strict output of property values only available for single-"
+ "target, non-recursive propget operations"));
+
       for (i = 0; i < targets->nelts; i++)
         {
           const char *target = APR_ARRAY_IDX(targets, i, const char *);
Index: subversion/svn/main.c
===================================================================
--- subversion/svn/main.c (revision 32461)
+++ subversion/svn/main.c (working copy)
@@ -688,9 +688,10 @@
      " By default, this subcommand will add an extra newline to the end\n"
      " of the property values so that the output looks pretty. Also,\n"
      " whenever there are multiple paths involved, each property value\n"
- " is prefixed with the path with which it is associated. Use\n"
- " the --strict option to disable these beautifications (useful,\n"
- " for example, when redirecting binary property values to a file).\n"),
+ " is prefixed with the path with which it is associated. Use the\n"
+ " --strict option to disable these beautifications (useful when re-\n"
+ " directing binary property values to a file, but available only if\n"
+ " you supply a single TARGET to a non-recursive propget operation).\n"),
     {'R', opt_depth, 'r', opt_revprop, opt_strict, opt_xml, opt_changelist } },
 
   { "proplist", svn_cl__proplist, {"plist", "pl"}, N_

Received on 2008-08-14 17:19:13 CEST

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.