You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Colin Watson <cj...@flatline.org.uk> on 2002/10/08 12:53:28 UTC

'svn propget -R' output difficult to parse

Hi,

I'm trying to build myself some kind of permissions support with
properties that I can use until proper support is available. While doing
so, I ran into the problem that the output of 'svn propget -R' can be
difficult to parse. Here's an example:

  [cjwatson@arborlon ~]$ svn ps cjwatson:unix-perms 700 .hide
  property `cjwatson:unix-perms' set on '.hide'
  [cjwatson@arborlon ~]$ svn pg -R cjwatson:unix-perms
  700
  [cjwatson@arborlon ~]$ svn ps cjwatson:unix-perms 600 .muttrc 
  property `cjwatson:unix-perms' set on '.muttrc'
  [cjwatson@arborlon ~]$ svn pg -R cjwatson:unix-perms      
  ./.hide - 700
  ./.muttrc - 600
  [cjwatson@arborlon ~]$ svn revert .muttrc
  Reverted .muttrc
  [cjwatson@arborlon ~]$ svn pg -R cjwatson:unix-perms .  
  700
  [cjwatson@arborlon ~]$ svn pg -R cjwatson:unix-perms . .
  ./.hide - 700
  ./.hide - 700

The -R flag alone isn't enough to trigger filenames being printed, which
makes the output useless - I can't tell from the value of the property
in the output of the second command above what filename it refers to. I
think that filenames should always be printed when -R is used.

Here's what seems to be a workable patch against 3327:

Index: subversion/clients/cmdline/propget-cmd.c
===================================================================
--- subversion/clients/cmdline/propget-cmd.c
+++ subversion/clients/cmdline/propget-cmd.c	2002-10-08 05:02:32.000000000 +0100
@@ -117,7 +117,8 @@
           SVN_ERR (svn_client_propget (&props, pname_utf8, target,
                                        opt_state->recursive, pool));
           
-          print_filenames = (targets->nelts > 1 || apr_hash_count (props) > 1);
+          print_filenames = (opt_state->recursive || targets->nelts > 1
+                             || apr_hash_count (props) > 1);
           
           for (hi = apr_hash_first (pool, props); hi; hi = apr_hash_next (hi))
             {

Is this sane, and if so should I file a bug? I scanned through recent
list archives and bug reports and couldn't see anything relevant.

Thanks,

-- 
Colin Watson                                  [cjwatson@flatline.org.uk]

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: 'svn propget -R' output difficult to parse

Posted by Philip Martin <ph...@codematters.co.uk>.
Colin Watson <cj...@flatline.org.uk> writes:

> Index: subversion/clients/cmdline/propget-cmd.c
> ===================================================================
> --- subversion/clients/cmdline/propget-cmd.c
> +++ subversion/clients/cmdline/propget-cmd.c	2002-10-08 05:02:32.000000000 +0100
> @@ -117,7 +117,8 @@
>            SVN_ERR (svn_client_propget (&props, pname_utf8, target,
>                                         opt_state->recursive, pool));
>            
> -          print_filenames = (targets->nelts > 1 || apr_hash_count (props) > 1);
> +          print_filenames = (opt_state->recursive || targets->nelts > 1
> +                             || apr_hash_count (props) > 1);
>            
>            for (hi = apr_hash_first (pool, props); hi; hi = apr_hash_next (hi))
>              {
> 
> Is this sane, and if so should I file a bug?

Yes, no.  Patch applied in rev 3328.

-- 
Philip Martin

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org