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

Re: [RFC]: Make svnlook (pg|pl) output format mimic svn (pg|pl) & add --show-inherited-props option

From: Paul Burba <ptburba_at_gmail.com>
Date: Tue, 20 Nov 2012 16:14:55 -0500

On Mon, Nov 19, 2012 at 5:27 PM, Johan Corveleyn <jcorvel_at_gmail.com> wrote:
> On Mon, Nov 19, 2012 at 9:04 PM, Paul Burba <ptburba_at_gmail.com> wrote:
>> Recently Johan proposed supporting multiple targets for svnlook
>> propget: http://svn.haxx.se/dev/archive-2012-11/0439.shtml
>>
>> One of the ideas that came of this was to make the output of 'svnlook
>> (pl|pg)' mimic the output of 'svn (pl|pg)'. This dovetails nicely
>> with my desire to add the ''show-inherited-props" option to svnlook
>> (pl|pg): http://svn.haxx.se/dev/archive-2012-11/0432.shtml
>
> +1 in general. Thanks for taking this on.
>
> I have a couple of questions though ... see below.
>
>> The question is, how far do we go with the backwards incompatible
>> changes to the output of svnlook (pg|pl)? Here's what we have today
>> (skip ahead to "PROPOSED CHANGES:" if you already know all this):
>>
>> ### svn proplist Today: ###
>>
>>>svn pl A\B
>> Properties on 'A\B':
>> svn:auto-props
>> svn:global-ignores
>>
>>>svn pl A\B -v
>> Properties on 'A\B':
>> svn:auto-props
>> *.c=svn:eol-style=native
>> *.h=svn:eol-style=native
>>
>> svn:global-ignores
>> *.pyc
>>
>>>svn pl A\B --show-inherited-props
>> Properties inherited from
>> 'C:\SVN\src-trunk-2\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
>> svn:auto-props
>> Properties on 'A\B':
>> svn:auto-props
>> svn:global-ignores
>
> So this means that you don't show which node is actually the "target"
> of these inherited props. What happens when you provide multiple
> arguments ('svn pl A/B C/D --show-inherited-props')? Can a user see
> (or a tool parse) which inherited props apply to which, or do they
> have to depend on the order? What if one of the targets doesn't have
> properties of its own (so no 'Properties on X' line), but does have
> inherited props ... how will you know on which node they apply?

The ordering, as you imply, is useful if every target has explicit properties:

>svn pl --show-inherited-props T1, T2, ...

Properties inherited from T1's most distant WC-or-URL parent (if any)
Properties inherited from T1's 2nd most distant WC-or-URL parent (if any)
Properties inherited from T1's 3rd most distant WC-or-URL parent (if any)
.
.
Properties inherited from T1's immediate WC-or-URL parent (if any)
(Explicit) Properties on T1 (if any)
Properties inherited from T2's most distant WC-or-URLparent (if any)
Properties inherited from T2's 2nd most distant WC-or-URL parent (if any)
Properties inherited from T2's 3rd most distant WC-or-URL parent (if any)
.
.
Properties inherited from T2's immediate WC-or-URL parent (if any)
(Explicit) Properties on T2 (if any)
.
.

If some or none of the targets don't have explicit properties, then we
are left to parse the WC-or-URL parent path to check if it is a parent
of the target in question. That's fine for a script/tool, but
certainly leaves a bit to be desired for human eyes...

> Maybe the output should become something like:
>
> Properties on 'A\B' inherited from
> 'C:\SVN\src-trunk-2\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
> svn:auto-props
> Properties on 'A\B':
> svn:auto-props
> svn:global-ignores
>
> ?

...so something like your proceeding suggestion would be helpful. I
made such a change in r1411831 except I tweaked your wording just a
bit so the line starts with "Inherited properties on" rather than
"Properties on 'path'". I think this makes it clearer at a glance
when we are dealing with inherited vs. explicit properties. For
example:

>svn pl --show-inherited-props B\Y\bar.c
Inherited properties on 'B\Y\bar.c',
from 'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
Inherited properties on 'B\Y\bar.c',
from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
  svn:auto-props
Inherited properties on 'B\Y\bar.c',
from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30\B':
  svn:auto-props
Properties on 'B\Y\bar.c':
  svn:eol-style

>svn pl --show-inherited-props B\Y\bar.c -v
Inherited properties on 'B\Y\bar.c',
from 'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
    *.h=svn:eol-style=native

Inherited properties on 'B\Y\bar.c',
from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
  svn:auto-props
    *.py=svn:eol-style=native
    *.c=svn:eol-style=native
    *.h=svn:eol-style=native

Inherited properties on 'B\Y\bar.c',
from 'C:\SVN\src-trunk\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30\B':
  svn:auto-props
    *.c=svn:eol-style=CR
    *.h=svn:eol-style=CR
    *.py=svn:eol-style=CR

Properties on 'B\Y\bar.c':
  svn:eol-style
    CR

(Yes, we can bikeshed this as necessary :-)

> The same applies to propget.

I assume you are speaking only of 'svn pg -v' here? As you point out
the limitations of 'svn pg' sans -v below. As part of r1411830 I also
tweaked the 'svn pg -v' output from this:

>svn pg svn:auto-props --show-inherited-props -v D D\G
Properties inherited from
'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
    *.h=svn:eol-style=native

Properties inherited from '.':
  svn:auto-props
    *.py=svn:eol-style=native

Properties on 'D':
  svn:auto-props
    *.c=svn:eol-style=native

Properties inherited from
'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
    *.h=svn:eol-style=native

Properties inherited from '.':
  svn:auto-props
    *.py=svn:eol-style=native

Properties inherited from 'D':
  svn:auto-props
    *.c=svn:eol-style=native

Properties on 'D\G':
  svn:auto-props
    *.txt=svn:eol-style=native

To this:

>svn pg svn:auto-props --show-inherited-props -v D D\G
Inherited properties on 'D',
from 'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
    *.h=svn:eol-style=native

Inherited properties on 'D',
from '.':
  svn:auto-props
    *.py=svn:eol-style=native

Properties on 'D':
  svn:auto-props
    *.c=svn:eol-style=native

Inherited properties on 'D\G',
from 'file:///C:/SVN/src-trunk/Debug/subversion/tests/cmdline/svn-test-work/repositories/autoprop_tests-30':
  svn:auto-props
    *.h=svn:eol-style=native

Inherited properties on 'D\G',
from '.':
  svn:auto-props
    *.py=svn:eol-style=native

Inherited properties on 'D\G',
from 'D':
  svn:auto-props
    *.c=svn:eol-style=native

Properties on 'D\G':
  svn:auto-props
    *.txt=svn:eol-style=native

>>>svn pl A\B --show-inherited-props -v
>> Properties inherited from
>> 'C:\SVN\src-trunk-2\Debug\subversion\tests\cmdline\svn-test-work\working_copies\autoprop_tests-30':
>> svn:auto-props
>> *.py=svn:eol-style=native
>> *.cpp=svn:eol-style=native
>>
>> Properties on 'A\B':
>> svn:auto-props
>> *.c=svn:eol-style=native
>> *.h=svn:eol-style=native
>>
>> svn:global-ignores
>> *.pyc
>>
>> ### svnlook proplist Today: ###
>>
>>>svnlook pl autoprop_tests-30 A/B
>> svn:global-ignores
>> svn:auto-props
>>
>>>svnlook pl autoprop_tests-30 A/B -v
>> svn:global-ignores : *.pyc
>>
>> svn:auto-props : *.c=svn:eol-style=native
>> *.h=svn:eol-style=native
>>
>> ### svn propget Today: ###
>>
>>>svn pg svn:auto-props ^^/A/B
>> *.c=svn:eol-style=native
>> *.h=svn:eol-style=native
>
> Note that this output (without -v) changes when there are multiple targets:
>
>>svn pg svn:auto-props A/B C/D
> A/B - *.c=svn:eol-style=native
> *.h=svn:eol-style=native
>
> C/D - *.py=svn:eol-style=native
> *.pl=svn:eol-style=native
>
>
> Or with a single-line prop:
>
>>svn pg svn:eol-style foo.txt bar.txt
> foo.txt - native
> bar.txt - native
>
>
> This output isn't exactly great (not parseable for multiline props),
> but it's okay for single-line props.
>
> In any case, we should also
> define what this (multi-arg but without -v) looks like in the case of
> 'svnlook pg'.

Just to be clear, I'm *not* planning on tackling multi-target support
for 'svnlook pg|pl'. I was only proposing that the output in the
single target case mimic that of 'svn pg|pl'.

I agree, the non-verbose output for 'svn pg' isn't very useful in some
circumstances, not just multi-line props, but also with the multiple
targets with the --show-inherited-props option, particularly when (as
you pointed out above for 'svn pg') the targets themselves don't have
explicit properties. But we have easy workarounds: --xml and -v. As
for 'svnlook pg', soon it will have the --verbose option. Perhaps
that is sufficient?

-- 
Paul T. Burba
CollabNet, Inc. -- www.collab.net -- Enterprise Cloud Development
Skype: ptburba
Received on 2012-11-20 22:15:28 CET

This is an archived mail posted to the Subversion Dev mailing list.