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

Re: New FS API, open_path, cloning and dag_node_t

From: Branko Èibej <brane_at_xbc.nu>
Date: 2001-02-14 00:55:03 CET

Karl Fogel wrote:

> The parent information should not be recorded in dag_node_t. A
> dag_node_t represents a node in the dag filesystem, and may have
> multiple parents (even in one revision tree).

Yes, but during the lifetime of a trail -- that is, within one
"tree.c"-level operation -- we're interested only in the path we used to
reach the node.

> The information you're trying to preserve isn't information the dag
> filesystem knows or cares about -- parent information is important
> only to the "virtual filesystem", uh, perhaps better called the
> "versioning filesystem". (Whichever it is, I'll call it the vfs from
> now on).
>
> A dag_node_t is currently something we can retrieve by key (see
> svn_fs_id_t). The value associated with that key knows nothing about
> parent information. So if dag_node_t had a parent fields, then when
> we retrieve a dag_node_t it would have to be incomplete.

O.K., that's reasonable. I'm mixing the layers again.

> Remember svn_fs_node_t? Tracking this kind of information was one of
> the main reasons we had it. Svn_fs_node_t was a superset of
> dag_node_t; it held the dag node and also the metadata needed to
> differentiate two nodes in the vfs even if they shared the same
> underlying dag node.
>
> So maybe the real question is: should we still have svn_fs_node_t or
> something like it, at least to preserve the
> path-by-which-we-got-to-this-dag-node and any other information
> layered on top of dag nodes?

We do. Otherwise we can't clone a whole path. Remember that we /do/ need
to clone a (sub) path in every FS operation that modifies a node. We can
only do that if we have a list of dag nodes that corresponds to the path.

Actually, we need a list of (node, name) pairs, where each "name" is a
path component. That's because we have to modify the dir entry called
"name" when we clone a node's child.

open_node can create this list (it has all the bits at its fingertips).
Maybe we should have something like this:

    struct named_node {
      const char *name;
      dag_node_t *node;
    };

    svn_error_t *open_path (apr_array_header_t **named_nodes,
                            svn_fs_root_t *root,
                            const char *path,
                            trail_t *trail);

-- 
Brane �ibej
    home:   <brane_at_xbc.nu>             http://www.xbc.nu/brane/
    work:   <branko.cibej_at_hermes.si>   http://www.hermes-softlab.com/
     ACM:   <brane_at_acm.org>            http://www.acm.org/
Received on Sat Oct 21 14:36:22 2006

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.