You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Greg Stein <gs...@lyra.org> on 2002/02/12 23:30:30 UTC

Re: svn commit: rev 1228 - trunk/subversion/include trunk/subversion/libsvn_wc trunk/subversion/libsvn_subr trunk/subversion/libsvn_ra_local trunk/subversion/libsvn_client trunk/subversion/libsvn_ra_dav

whew... big one to review. took me a while to get to...

On Fri, Feb 08, 2002 at 08:22:13PM -0600, sussman@tigris.org wrote:
>...
> +++ NEW/trunk/subversion/libsvn_wc/get_editor.c	Fri Feb  8 20:22:13 2002
>...
> +svn_wc_install_file (const char *file_path,
> +                     svn_revnum_t new_revision,
> +                     const char *new_text_path,
> +                     const apr_array_header_t *props,
> +                     svn_boolean_t is_full_proplist,
> +                     apr_pool_t *pool)
>...
> +      if (is_full_proplist)
> +        {         
> +          /* If the caller passed a definitive list that represents all
> +             of the file's properties, we need to compare it to the
> +             current 'pristine' list and deduce the differences. */

Why? If a full proplist is provided, then just install the darned thing. The
current code generates diffs between the full set and the current set, and
then later applies those diffs to generate the full set.

Seems a bit complex :-)

>...
>        /* foreach entry prop... */
> -      for (i = 0; i < fb->entrypropchanges->nelts; i++)
> +      for (i = 0; i < entry_props->nelts; i++)
>          {
>            const svn_prop_t *prop;
>            svn_stringbuf_t *propname;
>            svn_stringbuf_t *propval;
> +          enum svn_prop_kind kind;
> +          int prefix_len;

The "kind" variable is unued.


Other than those two items... wow. Excellent commit. I'm really psyched to
see all that stuff disappear from the file_baton!!

Note that we also have some issues with RA->get_file() returning a hash that
points to some stringbuf_t, some string_t items. Obviously, it is working
fine because we aren't trying to change the prop values, and because the
structures happen to be mildly compatible.

We can leave that for now, and clean it up with the other prop cleanup.

(and part of that is to convert all prop hashes to svn_string_t values)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

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

Re: prop diffs in svn_wc_install_file() (was: svn commit: rev 1228 - trunk/subversion/include trunk/subversion/libsvn_wc trunk/subversion/libsvn_subr trunk/subversion/libsvn_ra_local trunk/subversion/libsvn_client trunk/subversion/libsvn_ra_dav)

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Greg Stein <gs...@lyra.org> writes:
> Hmm. Then some documentation needs to be updated and/or we don't have the
> full set of options:
> 
> 1) "here are some prop change to apply"
> 2) "here is a complete list of props; warn me of conflicts"
> 3) "here is a complete list of props; aply them"
> 
> I assumed that the semantics were (1) and (3). You're saying (1) and (2).
> 
> Given (2), I can see how a prop diff might be useful. But a simpler scheme
> is to apply the proplist and have the pristine and the current set handy
> (3-way merge rears its head). Rather than computing a new list, when you
> apply each prop in turn, you just check if the prop has changed between
> pristine and current. It obviates the need for the whole "compute prop
> diffs" stuff.

Yah; let's see what Ben says, maybe my guess is way off base...

-K


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

prop diffs in svn_wc_install_file() (was: svn commit: rev 1228 - trunk/subversion/include trunk/subversion/libsvn_wc trunk/subversion/libsvn_subr trunk/subversion/libsvn_ra_local trunk/subversion/libsvn_client trunk/subversion/libsvn_ra_dav)

Posted by Greg Stein <gs...@lyra.org>.
On Tue, Feb 12, 2002 at 08:50:33PM -0600, Karl Fogel wrote:
> Greg Stein <gs...@lyra.org> writes:
> > Why? If a full proplist is provided, then just install the darned thing. The
> > current code generates diffs between the full set and the current set, and
> > then later applies those diffs to generate the full set.
> > 
> > Seems a bit complex :-)
> 
> I don't want to put words in Ben's mouth, but I think this is for
> detecting local prop mods.  I.e., you have the new full set, and the
> old pristine set, but you still have to discover the differences
> between those two to know if you've got a prop conflict.

Hmm. Then some documentation needs to be updated and/or we don't have the
full set of options:

1) "here are some prop change to apply"
2) "here is a complete list of props; warn me of conflicts"
3) "here is a complete list of props; aply them"

I assumed that the semantics were (1) and (3). You're saying (1) and (2).

Given (2), I can see how a prop diff might be useful. But a simpler scheme
is to apply the proplist and have the pristine and the current set handy
(3-way merge rears its head). Rather than computing a new list, when you
apply each prop in turn, you just check if the prop has changed between
pristine and current. It obviates the need for the whole "compute prop
diffs" stuff.

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

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

Re: svn commit: rev 1228 - trunk/subversion/include trunk/subversion/libsvn_wc trunk/subversion/libsvn_subr trunk/subversion/libsvn_ra_local trunk/subversion/libsvn_client trunk/subversion/libsvn_ra_dav

Posted by Karl Fogel <kf...@newton.ch.collab.net>.
Greg Stein <gs...@lyra.org> writes:
> Why? If a full proplist is provided, then just install the darned thing. The
> current code generates diffs between the full set and the current set, and
> then later applies those diffs to generate the full set.
> 
> Seems a bit complex :-)

I don't want to put words in Ben's mouth, but I think this is for
detecting local prop mods.  I.e., you have the new full set, and the
old pristine set, but you still have to discover the differences
between those two to know if you've got a prop conflict.


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

Re: svn commit: rev 1228 - trunk/subversion/include trunk/subversion/libsvn_wc trunk/subversion/libsvn_subr trunk/subversion/libsvn_ra_local trunk/subversion/libsvn_client trunk/subversion/libsvn_ra_dav

Posted by Ben Collins-Sussman <su...@collab.net>.
Greg Stein <gs...@lyra.org> writes:

> > +      if (is_full_proplist)
> > +        {         
> > +          /* If the caller passed a definitive list that represents all
> > +             of the file's properties, we need to compare it to the
> > +             current 'pristine' list and deduce the differences. */
> 
> Why? If a full proplist is provided, then just install the darned thing. The
> current code generates diffs between the full set and the current set, and
> then later applies those diffs to generate the full set.

"Install the darned thing"?  You mean *merge* the darned thing.  The
user might have local propchanges that conflict!

The problem was not wanting to rewrite the universe.  

Here's what we currently have:  a function that takes a "list of prop
deltas" and merges them into both the pristine and working props.  If
any working props conflict, a .prej file is created.  All of this
stuff is done via our 'journal first, then execute' techniques.

That's swell.  But now I have two callers of svn_wc_install_file:  one
of them is the update-editor:  it has file and dir batons that are
caching propchanges during the edit.  The other caller is
svn_client_switch(), which receives a *full* proplist from
RA->get_file(). 

So with my back to the wall, I had to choose an interface for
svn_wc_install_file.  After talking with Karl, we decided that the
interface should take a list of props, and a flag would indicate
whether it was a list of deltas, or a "complete" list.

In the case of the update-editor (which is by far the most common
caller), it can just pass the baton's propchanges straight in, and the
function can pass the propchanges straight to the
property-merging-routine.  Smooth as butter.

In the other case, things were uglier.  svn_client_switch converts a
hash of complete props into a list of complete props.  Then it passes
the list to svn_wc_install_file, with the flag set.  Seeing that it's
a new "complete" list, svn_wc_install_file loads up the currently
installed pristine proplist, and calls a pre-existing routine which
creates a list of changes *between* the two complete lists.  Then it
passes the list of propchanges to the merging routine.

I think the proper solution (someday) is to rewrite the property merging
routine itself.  All the work in the previous paragraph should
probably be done *inside* the prop-merging routine, and this routine
should take either type of list. 

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