You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "B. W. Fitzpatrick" <fi...@red-bean.com> on 2002/05/29 05:15:09 UTC

Just say no to collections: moving wc meta-data out of the wc

After last week's posting about implementing opaque collections, I had
several off-list discussions in which I was convinced (read:
browbeaten) into seeing that implementing collections is not The Right
Thing to do.

To summarize some of the points that were made:

- Collections, as described in my previous email, are an unnecessarily
  complex solution to the problem we need to solve.
- Yes, Apple's tools that deal with document bundles shouldn't delete
  our metadata.
- We have a chicken and the egg problem when doing checkouts.
- How deep can these collections go? Where does the metadata for
  subdirectories go?
- etc.

Now what?
---------

Convenience issues aside, our problems go away if we can store working
copy metadata somewhere outside of the working copy. 

It was suggested that we (me) create a runtime configuration option
that, when set, would store the working copy metadata in a static
location. The directory layout of the meta data would mirror the
directory layout of the working copy. For example, in
~/.subversion/config we might have:

    store-meta-data-outside-wc = true

So, if we checkout a working copy to here:

    /home/fitz/svn-work/myproj/
                               dir1/
                                    foo
                                    bar
                               dir2/
                                    baz
                                    dir2subdir1/
                                                bat
    
The following directories will be created to hold the wc metadata:

    /home/fitz/.subversion/metadata/some-cheesy-wc-id/
                                                      dir1/
                                                      dir2/
                                                           dir2subdir1/

And, some config file (location and format TBD) will contain a lookup
dictionary something like this:

    KEY                          VALUE
    /home/fitz/svn-work/myproj = 
        (http://svn.myserver.com/repos/trunk/path/to/myproj, some-cheesy-wc-id)

So, when svn is invoked in a working copy, take $CWD as path, and
using it as a key, load up the above-mentioned table, and try to get a
value from a for that key. If we get null back, remove the last path
element and try to get a value again. Continue walking up the FS tree
until we get a value returned. If we get null all the way up, we're
not in a working copy. (Note that this mechanism handles nested working
copies from diverse repositories).

This, however, means that if you move a Subversion working copy,
Subversion will not be able to find its metadata. We would need to
have some way to tell the svn client that we've moved a working copy
(something like 'svn move-wc /from/this/path /to/this/path). 

With our meta-data out of the way, bundled documents are just like any
other directory structure to Subversion. And our lookup dictionary
means that we don't need to worry about drive letters on
win32. Joy. Oh, and you don't have to resort to bizarre 'find'
incantations when hunting for stuff in your working copies. :)

You may notice that the filesystem path above points to a tuple
containing the Base URI of the wc as well as the wc meta-data ID. This
will actually allow our client the ability to enumerate through
checked out working copies and map them easily to repositories
(Although can't we derive that from a wc's metadata?). Bill Tutt might
want to explain more about that. :)

Comments?

-Fitz

PS Thanks to Bill, Sander, and Ben for all their help (and occasional abuse).




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

Re: Just say no to collections: moving wc meta-data out of the wc

Posted by mark benedetto king <bk...@answerfriend.com>.
> 
> My main concern is that this might make it difficult for emacs vc-mode
> to determine whether a directory is under Subversion control.  (It's
> certainly not okay to ask it to run an svn command before even deciding
> that the directory has anything to do with Subversion.)
> 

The perforce/emacs integration scripts that I've seen do this
by parsing the client configuration themselves to determine the
mapping between local directory and repository.

--ben



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

Re: Just say no to collections: moving wc meta-data out of the wc

Posted by Greg Hudson <gh...@MIT.EDU>.
On Wed, 2002-05-29 at 01:15, B. W. Fitzpatrick wrote:
> - We have a chicken and the egg problem when doing checkouts.

I don't get it.

> - How deep can these collections go? Where does the metadata for
>   subdirectories go?

As deep as they want.  Still in the parent directory.  I don't see the
problem here.

> Convenience issues aside, our problems go away if we can store working
> copy metadata somewhere outside of the working copy. 

Not really.  A collection also has the property that you want to
automatically add and remove files on commit.  (Perhaps that's not an
issue for Interface Builder, but I hope this feature isn't tailored for
exactly one program.)

> It was suggested that we (me) create a runtime configuration option
> that, when set, would store the working copy metadata in a static
> location. The directory layout of the meta data would mirror the
> directory layout of the working copy.

My main concern is that this might make it difficult for emacs vc-mode
to determine whether a directory is under Subversion control.  (It's
certainly not okay to ask it to run an svn command before even deciding
that the directory has anything to do with Subversion.)


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

Re: Just say no to collections: moving wc meta-data out of the wc

Posted by cm...@collab.net.
"Bill Tutt" <ra...@lyra.org> writes:

> Not just the URL of the WC root. The BaseURI of the repository we're
> connecting to. IIRC, we still don't know that information from the WC do
> we?

Oh.  Is that what fitz meant?  In that case, we *will* be able to look
at the "repos" attribute of the entry in the entries file, but this
code hasn't been added to Subversion yet.

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

RE: Re: Just say no to collections: moving wc meta-data out of the wc

Posted by Bill Tutt <ra...@lyra.org>.
Not just the URL of the WC root. The BaseURI of the repository we're
connecting to. IIRC, we still don't know that information from the WC do
we?

Bill
----
Do you want a dangerous fugitive staying in your flat?
No.
Well, don't upset him and he'll be a nice fugitive staying in your flat.
 

> -----Original Message-----
> From: cmpilato@red-bean.com [mailto:cmpilato@red-bean.com]
> Sent: Wednesday, May 29, 2002 5:58 AM
> To: B. W. Fitzpatrick
> Cc: dev@subversion.tigris.org
> Subject: Re: Just say no to collections: moving wc meta-data out of
the wc
> 
> "B. W. Fitzpatrick" <fi...@red-bean.com> writes:
> 
> > You may notice that the filesystem path above points to a tuple
> > containing the Base URI of the wc as well as the wc meta-data ID.
This
> > will actually allow our client the ability to enumerate through
> > checked out working copies and map them easily to repositories
> > (Although can't we derive that from a wc's metadata?). Bill Tutt
might
> > want to explain more about that. :)
> 
> Yeah, we can derive the URL from the meta data.  The "url" attribute
> in the entries files should do the trick.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: dev-help@subversion.tigris.org



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

Re: Just say no to collections: moving wc meta-data out of the wc

Posted by cm...@red-bean.com.
"B. W. Fitzpatrick" <fi...@red-bean.com> writes:

> You may notice that the filesystem path above points to a tuple
> containing the Base URI of the wc as well as the wc meta-data ID. This
> will actually allow our client the ability to enumerate through
> checked out working copies and map them easily to repositories
> (Although can't we derive that from a wc's metadata?). Bill Tutt might
> want to explain more about that. :)

Yeah, we can derive the URL from the meta data.  The "url" attribute
in the entries files should do the trick.

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