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

Re: [RFC] Inheritable Properties Branch: Ready for Review

From: Paul Burba <ptburba_at_gmail.com>
Date: Thu, 13 Sep 2012 12:02:36 -0400

On Thu, Sep 13, 2012 at 10:47 AM, Julian Foad
<julianfoad_at_btopenworld.com> wrote:
> Paul Burba wrote:
>
>> A while back I started working on a branch[1] to implement inheritable
>> properties, ultimately in pursuit of a server dictated config
>> solution, as discussed here
>> http://svn.haxx.se/dev/archive-2012-02/0207.shtml
>>
>> I've finished the generic inherited properties solution I described in
>> the wiki found here
>> http://wiki.apache.org/subversion/InheritedProperties.
>
> Hi Paul. That's great.
>
>> Any feedback, review, questions, etc. are appreciated. If you do want
>> to take a look I suggest starting with the wiki.
>
> The main thing I wanted to check is the inheritance in the WC, since I didn't understand it when we wrote question-and-answer about it long ago in the Wiki. I think diagrams will make it easier.
>
> So I tried it, and this is what I found. It's simple and it's fine; I have no issue with it, I just wanted to reach a clear statement of it.
>
>
> This example assumes there is a property 'p' which is explicitly set (to different values) on the BASE version of every node shown. Also it is explicitly set (that is, modified) to some other different values on the ACTUAL version of every node shown. This table shows all the explicitly set values of the property named 'p':
>
> PATH BASE PROPVAL ACTUAL PROPVAL
>
> wc b1 a1
> |
> +-doc b2 a2
> |
> +-README b3 a3
>
> Trying it now (with 'wc' as the working directory), I see that the ACTUAL properties are inherited from the ACTUAL parent:
>
> $ svn pl -v --show-inherited-props .
> Properties on '.':
> p
> a1
> $ svn pl -v --show-inherited-props ./doc
> Properties inherited from '/home/julianfoad/tmp/svn/inh/wc':
> p
> a1
> Properties on 'doc':
> p
> a2
> $ svn pl -v --show-inherited-props ./doc/README
> Properties inherited from '/home/julianfoad/tmp/svn/inh/wc':
> p
> a1
> Properties inherited from '/home/julianfoad/tmp/svn/inh/wc/doc':
> p
> a2
> Properties on 'doc/README':
> p
> a3
>
>
> and BASE properties are inherited from the BASE parent:
>
> $ svn pl -v -rBASE --show-inherited-props .
> Properties on '.':
> p
> b1
> $ svn pl -v -rBASE --show-inherited-props ./doc
> Properties inherited from 'file:///home/julianfoad/tmp/svn/inh/repo':
> p
> b1
> Properties on 'doc':
> p
> b2
> $ svn pl -v -rBASE --show-inherited-props ./doc/README
> Properties inherited from 'file:///home/julianfoad/tmp/svn/inh/repo':
> p
> b1
> Properties inherited from 'file:///home/julianfoad/tmp/svn/inh/repo/doc':
> p
> b2
> Properties on 'doc/README':
> p
> b3
>
>
> So we can complete the picture with arrows that show which way the properties are inherited.
>
> wc b1 a1
> | | |
> | v v
> +-doc b2 a2
> | | |
> | v v
> +-README b3 a3
>
> Or, more simply,
>
> wc BASE ACTUAL
> | | |
> | v v
> +-doc BASE ACTUAL
> | | |
> | v v
> +-README BASE ACTUAL
>
> And then, adding the info about what happens above the WC root:
>
> parent dir in repo NODE
> | | \_____________
> | v v
> +-wc root dir BASE ACTUAL
> | | |
> | v v
> +-doc BASE ACTUAL
> | | |
> | v v
> +-README BASE ACTUAL

Hi Julian,

This isn't quite what I had in mind (nor how the branch is currently
implemented). Recall from above when we ask for README's base:

 $ svn pl -v -rBASE --show-inherited-props ./doc/README
 Properties inherited from 'file:///home/julianfoad/tmp/svn/inh/repo':
   p
     b1
 Properties inherited from 'file:///home/julianfoad/tmp/svn/inh/repo/doc':
   p
     b2
 Properties on 'doc/README':
   p
     b3

The properties inherited by README are not obtained from the WC at
all, but are from the repository (hence the URLs). What is happening
is really this:

 parent dir in repo NODE
 | | \_____________
 | | v
 +-wc root dir repos ACTUAL
   | parent |
   | NODE |
   | | |
   | | v
   +-doc repos ACTUAL
     | parent |
     | NODE |
     | | |
     | v v
     +-README BASE ACTUAL

Now in this example the inherited values are the same, but we only
have the BASE value for README's explicit props in the WC, the
inherited values for its parents are still coming from the repos. We
can see how the ACTUAL and BASE iprops would differ if we replaced
README with a file from elsewhere in the repos:

>svn st -v
 M 4 3 pburba .
 M 4 3 pburba doc
 M 4 3 pburba doc\readme

>svn revert -R doc\readme
Reverted 'doc\readme'

>svn del doc\readme
D doc\readme

>svn copy ^^/A/D/H/psi doc\readme
A doc\readme

Inheritance in the ACTUAL tree is as per your diagram above (note that
the replaced file has no explicit props) -- think of this ACTUAL tree
as the "proto-revision" mentioned in the wiki (an idea I happily stole
from you, but for which I take full blame if I've butchered :-)

>svn pl -v --show-inherited-props doc\readme
Properties inherited from
'S:\SVN\src-trunk-4\Debug\subversion\tests\cmdline\svn-test-work\working_copies\iprop_tests-1':
  p
    a1
Properties inherited from
'S:\SVN\src-trunk-4\Debug\subversion\tests\cmdline\svn-test-work\working_copies\iprop_tests-1\doc':
  p
    a2

But if we ask about the BASE of the locally replaced file, we trace
back to the copy source's base:

>svn pl -v --show-inherited-props doc\readme -rBASE
Properties inherited from
'file:///S:/SVN/src-trunk-4/Debug/subversion/tests/cmdline/svn-test-work/repositories/iprop_tests-1/A/D/H':
  p
    x1

However once we commit these changes, the earlier "proto-revision" has
now become the BASE of README, so when we ask for the props inherited
by the BASE of readme they now reflect the newly committed revision:

>svn ci -m ""
Sending .
Sending doc
Replacing doc\readme

Committed revision 5.

>svn pl -v --show-inherited-props doc\readme -rBASE
Properties inherited from
'file:///S:/SVN/src-trunk-4/Debug/subversion/tests/cmdline/svn-test-work/repositories/iprop_tests-1/wc':
  p
    a1
Properties inherited from
'file:///S:/SVN/src-trunk-4/Debug/subversion/tests/cmdline/svn-test-work/repositories/iprop_tests-1/wc/doc':
  p
    a2

...and are the same props as the ACTUAL tree:

>svn pl -v --show-inherited-props doc\readme
Properties inherited from
'S:\SVN\src-trunk-4\Debug\subversion\tests\cmdline\svn-test-work\working_copies\iprop_tests-1':
  p
    a1
Properties inherited from
'S:\SVN\src-trunk-4\Debug\subversion\tests\cmdline\svn-test-work\working_copies\iprop_tests-1\doc':
  p
    a2

> (If at this point you're wondering what other picture I could possibly have imagined, your "principle: Inheritance within the WC is within the actual tree" made me wonder if you meant something like this:
>
> wc b1 a1
> | _____________/ |
> | v v
> +-doc b2 a2
> | _____________/ |
> | v v
> +-README b3 a3
>
> since I consider BASE nodes as well as ACTUAL nodes to be within the WC.)

That's why I tried to emphasize in the recent wiki updates
(http://wiki.apache.org/subversion/InheritedProperties#Working_Copy_Inheritance_Rules)
that there is a difference between the "default" WC inheritance, which
occurs in the actual tree, and inheritance that occurs when we provide
a operative/peg revision.

> So I think that's settled and we can delete my notes from the Wiki "WC Inheritance Rules" section if you agree.
>
> - Julian

-- 
Paul T. Burba
CollabNet, Inc. -- www.collab.net -- Enterprise Cloud Development
Skype: ptburba
Received on 2012-09-13 18:03:08 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.