You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by kf...@collab.net on 2005/11/08 20:17:34 UTC

Re: svn commit: r17234 - in trunk/subversion: libsvn_wc

malcolm@tigris.org writes:
> Log:
> Ensure that local property modifications aren't reported during diffs to
> BASE, by reporting against the BASE properties rather than the WORKING
> properties.

I had trouble understanding this log message.  Did you mean to say
"are" rather than "aren't"?  Or is there something deeper I'm missing?

I would think that local property modifications *should* be reported
during diffs against BASE, and that the clause following the comma in
your above paragraph describes how one would make that happen.

-Karl

> * subversion/libsvn_wc/diff.c
>   (close_directory, close_file): If diffing against the text-base,
>     use the BASE properties (instead of the cached WORKING properties)
>     as a base to pass, together with the BASE->repos propchanges, to
>     the diff callback functions.
> 
> * subversion/tests/clients/cmdline/diff_tests.py
>   (test_list): Unmark diff_property_changes_to_base as XFail.
> 
> 
> Modified: trunk/subversion/libsvn_wc/diff.c
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/libsvn_wc/diff.c?rev=17234&p1=trunk/subversion/libsvn_wc/diff.c&p2=trunk/subversion/libsvn_wc/diff.c&r1=17233&r2=17234
> ==============================================================================
> --- trunk/subversion/libsvn_wc/diff.c	(original)
> +++ trunk/subversion/libsvn_wc/diff.c	Mon Nov  7 09:31:08 2005
> @@ -953,14 +953,32 @@
>  
>    if (b->propchanges->nelts > 0)
>      {
> +      /* The working copy properties at the base of the wc->repos comparison:
> +         either BASE or WORKING. */
> +      apr_hash_t *wcprops;
> +
> +      if (b->edit_baton->use_text_base)
> +        {
> +          svn_wc_adm_access_t *adm_access;
> +
> +          SVN_ERR (svn_wc_adm_probe_retrieve (&adm_access,
> +                                              b->edit_baton->anchor,
> +                                              b->path, b->pool));
> +
> +          SVN_ERR (svn_wc_get_prop_diffs (NULL, &wcprops,
> +                                          b->path, adm_access, pool));
> +        }
> +      else
> +        wcprops = b->baseprops;
> +
>        if (! b->edit_baton->reverse_order)
> -        reverse_propchanges (b->baseprops, b->propchanges, b->pool);
> +        reverse_propchanges (wcprops, b->propchanges, b->pool);
>  
>        SVN_ERR (b->edit_baton->callbacks->dir_props_changed
>                 (NULL, NULL,
>                  b->path,
>                  b->propchanges,
> -                b->baseprops,
> +                wcprops,
>                  b->edit_baton->callback_baton));
>      }
>  
> @@ -1259,12 +1277,22 @@
>        else
>          localfile = temp_file_path = NULL;
>        
> -      if (b->propchanges->nelts > 0
> -          && ! eb->reverse_order)
> -        reverse_propchanges (b->baseprops, b->propchanges, b->pool);
> -
>        if (localfile || b->propchanges->nelts > 0)
>          {
> +          /* The working copy properties at the base of the wc->repos
> +             comparison: either BASE or WORKING. */
> +          apr_hash_t *wcprops;
> +
> +          if (eb->use_text_base)
> +            SVN_ERR (svn_wc_get_prop_diffs (NULL, &wcprops,
> +                                            b->path, adm_access, pool));
> +          else
> +            wcprops = b->baseprops;
> +
> +          if (b->propchanges->nelts > 0
> +              && ! eb->reverse_order)
> +            reverse_propchanges (wcprops, b->propchanges, b->pool);
> +
>            err1 = b->edit_baton->callbacks->file_changed
>              (NULL, NULL, NULL,
>               b->path,
> @@ -1274,7 +1302,7 @@
>               eb->reverse_order ? b->edit_baton->revnum : SVN_INVALID_REVNUM,
>               eb->reverse_order ? working_mimetype : pristine_mimetype,
>               eb->reverse_order ? pristine_mimetype : working_mimetype,
> -             b->propchanges, b->baseprops,
> +             b->propchanges, wcprops,
>               b->edit_baton->callback_baton);
>        
>            if (localfile && (! eb->use_text_base) && (! b->schedule_delete)
> 
> Modified: trunk/subversion/tests/clients/cmdline/diff_tests.py
> Url: http://svn.collab.net/viewcvs/svn/trunk/subversion/tests/clients/cmdline/diff_tests.py?rev=17234&p1=trunk/subversion/tests/clients/cmdline/diff_tests.py&p2=trunk/subversion/tests/clients/cmdline/diff_tests.py&r1=17233&r2=17234
> ==============================================================================
> --- trunk/subversion/tests/clients/cmdline/diff_tests.py	(original)
> +++ trunk/subversion/tests/clients/cmdline/diff_tests.py	Mon Nov  7 09:31:08 2005
> @@ -1990,7 +1990,7 @@
>                diff_keywords,
>                diff_force,
>                XFail(diff_renamed_dir),
> -              XFail(diff_property_changes_to_base),
> +              diff_property_changes_to_base,
>                ]
>  
>  if __name__ == '__main__':
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: svn-unsubscribe@subversion.tigris.org
> For additional commands, e-mail: svn-help@subversion.tigris.org
> 

-- 

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

Re: svn commit: r17234 - in trunk/subversion: libsvn_wc

Posted by kf...@collab.net.
Malcolm Rowe <ma...@farside.org.uk> writes:
> Sorry, that wasn't too clear, was it?  I've updated the log message now,
> and hopefully it makes more sense.  (Let me know if you think it still
> needs work, anyway).

Thanks, much clearer now!

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

Re: svn commit: r17234 - in trunk/subversion: libsvn_wc

Posted by Malcolm Rowe <ma...@farside.org.uk>.
On Tue, Nov 08, 2005 at 02:17:34PM -0600, kfogel@collab.net wrote:
> malcolm@tigris.org writes:
> > Log:
> > Ensure that local property modifications aren't reported during diffs to
> > BASE, by reporting against the BASE properties rather than the WORKING
> > properties.
> 
> I had trouble understanding this log message.  Did you mean to say
> "are" rather than "aren't"?  Or is there something deeper I'm missing?
> 
> I would think that local property modifications *should* be reported
> during diffs against BASE, and that the clause following the comma in
> your above paragraph describes how one would make that happen.
> 

Sorry, that wasn't too clear, was it?  I've updated the log message now,
and hopefully it makes more sense.  (Let me know if you think it still
needs work, anyway).

libsvn_wc/diff.c deals with diffs using the working copy as a target:
either repos-wc diffs (rN to either BASE or WORKING) or wc-wc diffs
(which are always BASE to WORKING).  In the case of repos-wc diffs,
we can also request that the whole diff be reversed, so we can use it
to produce a wc-repos diff as well.

The 'use_text_base' option is used to indicate whether the target wc
revision is BASE (which it can only be in repos-wc diffs).

The problem here was that you could do:

$ svn diff -rN:BASE wc
$ svn ps propname propval wc/foo
$ svn diff -rN:BASE wc

and the second diff would show the property change, which surely wasn't
intended.

Regards,
Malcolm

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