You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Peter Lundblad <pl...@google.com> on 2007/03/01 21:27:07 UTC

Re: svn commit: r23538 - in trunk/subversion: include libsvn_client libsvn_wc

Hi,

hwright@tigris.org writes:
> Modified: trunk/subversion/include/svn_wc.h
> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_wc.h?pathrev=23538&r1=23537&r2=23538
> ==============================================================================
> --- trunk/subversion/include/svn_wc.h	(original)
> +++ trunk/subversion/include/svn_wc.h	Thu Mar  1 12:53:06 2007
> @@ -474,8 +474,10 @@
>  /** One external item.  This usually represents one line from an
>   * svn:externals description but with the path and URL
>   * canonicalized.
> + *
> + * @since New in 1.5.
>   */
> -typedef struct svn_wc_external_item_t
> +typedef struct svn_wc_external_item2_t
>  {
>    /** The name of the subdirectory into which this external should be
>        checked out.  This is relative to the parent directory that
> @@ -492,23 +494,55 @@
>        svn_opt_revision_head. */
>    svn_opt_revision_t revision;
>  
> -} svn_wc_external_item_t;
> +  /** The peg revision to use when checking out.  THe only valid kinds are
> +      svn_opt_revision_number, svn_opt_revision_date, and
> +      svn_opt_revision_head. */
> +  svn_opt_revision_t peg_revision;
>  
> +} svn_wc_external_item2_t;
> +


Does it make sese to document this as extensible in the future, so we
don't have to rev it to add a field, ossibly adding a factory function
to create the struct if needed?  That has proven useful before;)

Thanks,
//Peter

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

Re: svn commit: r23538 - in trunk/subversion: include libsvn_client libsvn_wc

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Daniel Rall wrote:
> On Thu, 01 Mar 2007, Peter Lundblad wrote:
> 
>> Hi,
>>
>> hwright@tigris.org writes:
>>> Modified: trunk/subversion/include/svn_wc.h
>>> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_wc.h?pathrev=23538&r1=23537&r2=23538
>>> ==============================================================================
>>> --- trunk/subversion/include/svn_wc.h	(original)
>>> +++ trunk/subversion/include/svn_wc.h	Thu Mar  1 12:53:06 2007
>>> @@ -474,8 +474,10 @@
>>>  /** One external item.  This usually represents one line from an
>>>   * svn:externals description but with the path and URL
>>>   * canonicalized.
>>> + *
>>> + * @since New in 1.5.
>>>   */
>>> -typedef struct svn_wc_external_item_t
>>> +typedef struct svn_wc_external_item2_t
>>>  {
>>>    /** The name of the subdirectory into which this external should be
>>>        checked out.  This is relative to the parent directory that
>>> @@ -492,23 +494,55 @@
>>>        svn_opt_revision_head. */
>>>    svn_opt_revision_t revision;
>>>  
>>> -} svn_wc_external_item_t;
>>> +  /** The peg revision to use when checking out.  THe only valid kinds are
>>> +      svn_opt_revision_number, svn_opt_revision_date, and
>>> +      svn_opt_revision_head. */
>>> +  svn_opt_revision_t peg_revision;
>>>  
>>> +} svn_wc_external_item2_t;
>>> +
>>
>> Does it make sese to document this as extensible in the future, so we
>> don't have to rev it to add a field, ossibly adding a factory function
>> to create the struct if needed?  That has proven useful before;)
> 
> +1!

Done in r23554.

-Hyrum


Re: svn commit: r23538 - in trunk/subversion: include libsvn_client libsvn_wc

Posted by Daniel Rall <dl...@collab.net>.
On Thu, 01 Mar 2007, Peter Lundblad wrote:

> Hi,
> 
> hwright@tigris.org writes:
> > Modified: trunk/subversion/include/svn_wc.h
> > URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_wc.h?pathrev=23538&r1=23537&r2=23538
> > ==============================================================================
> > --- trunk/subversion/include/svn_wc.h	(original)
> > +++ trunk/subversion/include/svn_wc.h	Thu Mar  1 12:53:06 2007
> > @@ -474,8 +474,10 @@
> >  /** One external item.  This usually represents one line from an
> >   * svn:externals description but with the path and URL
> >   * canonicalized.
> > + *
> > + * @since New in 1.5.
> >   */
> > -typedef struct svn_wc_external_item_t
> > +typedef struct svn_wc_external_item2_t
> >  {
> >    /** The name of the subdirectory into which this external should be
> >        checked out.  This is relative to the parent directory that
> > @@ -492,23 +494,55 @@
> >        svn_opt_revision_head. */
> >    svn_opt_revision_t revision;
> >  
> > -} svn_wc_external_item_t;
> > +  /** The peg revision to use when checking out.  THe only valid kinds are
> > +      svn_opt_revision_number, svn_opt_revision_date, and
> > +      svn_opt_revision_head. */
> > +  svn_opt_revision_t peg_revision;
> >  
> > +} svn_wc_external_item2_t;
> > +
> 
> 
> Does it make sese to document this as extensible in the future, so we
> don't have to rev it to add a field, ossibly adding a factory function
> to create the struct if needed?  That has proven useful before;)

+1!

Re: svn commit: r23538 - in trunk/subversion: include libsvn_client libsvn_wc

Posted by Peter Lundblad <pl...@google.com>.
Hyrum K. Wright writes:
> While doing so, I found this function tucked in libsvn_client/externals.c:
> 
> static svn_boolean_t
> compare_external_items(svn_wc_external_item2_t *new_item,
>                        svn_wc_external_item2_t *old_item)
> {
...
> }
> 
> Should it be moved to libsvn_wc and exposed through the API?  (Perhaps
> svn_wc_external_item_eq() ?)  If we do expand the external_item
> structure again, equivalence checking should probably extend to the new
> fields as well.
> 
I don't think it needs to go public if it is not used anywhere else
(including other users of our libs).
Old code will always miss the new fields.  I think we have to live with
that.

Thanks,
//Peter

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

Re: svn commit: r23538 - in trunk/subversion: include libsvn_client libsvn_wc

Posted by "Hyrum K. Wright" <hy...@mail.utexas.edu>.
Peter Lundblad wrote:
> Hi,
> 
> hwright@tigris.org writes:
>> Modified: trunk/subversion/include/svn_wc.h
>> URL: http://svn.collab.net/viewvc/svn/trunk/subversion/include/svn_wc.h?pathrev=23538&r1=23537&r2=23538
>> ==============================================================================
>> --- trunk/subversion/include/svn_wc.h	(original)
>> +++ trunk/subversion/include/svn_wc.h	Thu Mar  1 12:53:06 2007
>> @@ -474,8 +474,10 @@
>>  /** One external item.  This usually represents one line from an
>>   * svn:externals description but with the path and URL
>>   * canonicalized.
>> + *
>> + * @since New in 1.5.
>>   */
>> -typedef struct svn_wc_external_item_t
>> +typedef struct svn_wc_external_item2_t
>>  {
>>    /** The name of the subdirectory into which this external should be
>>        checked out.  This is relative to the parent directory that
>> @@ -492,23 +494,55 @@
>>        svn_opt_revision_head. */
>>    svn_opt_revision_t revision;
>>  
>> -} svn_wc_external_item_t;
>> +  /** The peg revision to use when checking out.  THe only valid kinds are
>> +      svn_opt_revision_number, svn_opt_revision_date, and
>> +      svn_opt_revision_head. */
>> +  svn_opt_revision_t peg_revision;
>>  
>> +} svn_wc_external_item2_t;
>> +
> 
> 
> Does it make sese to document this as extensible in the future, so we
> don't have to rev it to add a field, ossibly adding a factory function
> to create the struct if needed?  That has proven useful before;)

That does make sense.  I'll make the change.

While doing so, I found this function tucked in libsvn_client/externals.c:

static svn_boolean_t
compare_external_items(svn_wc_external_item2_t *new_item,
                       svn_wc_external_item2_t *old_item)
{
  if ((strcmp(new_item->target_dir, old_item->target_dir) != 0)
      || (strcmp(new_item->url, old_item->url) != 0)
      || (! svn_client__compare_revisions(&(new_item->revision),
                                          &(old_item->revision)))
      || (! svn_client__compare_revisions(&(new_item->peg_revision),
                                          &(old_item->peg_revision))))
    return FALSE;

  /* Else. */
  return TRUE;
}

Should it be moved to libsvn_wc and exposed through the API?  (Perhaps
svn_wc_external_item_eq() ?)  If we do expand the external_item
structure again, equivalence checking should probably extend to the new
fields as well.

-Hyrum