You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Bert Huijben <be...@qqmail.nl> on 2011/08/08 18:11:42 UTC

RE: svn commit: r1155001 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/info.c svn/info-cmd.c svn/schema/info.rnc


> -----Original Message-----
> From: stsp@apache.org [mailto:stsp@apache.org]
> Sent: maandag 8 augustus 2011 18:05
> To: commits@subversion.apache.org
> Subject: svn commit: r1155001 - in /subversion/trunk/subversion:
> include/svn_wc.h libsvn_wc/info.c svn/info-cmd.c svn/schema/info.rnc
> 
> Author: stsp
> Date: Mon Aug  8 16:05:24 2011
> New Revision: 1155001
> 
> URL: http://svn.apache.org/viewvc?rev=1155001&view=rev
> Log:
> Show moved-to/moved-from information in 'svn info' output.
> 
> * subversion/include/svn_wc.h
>   (svn_wc_info_t): New fields MOVED_FROM_RELPATH and
> MOVED_TO_RELPATH.
> 
> * subversion/svn/info-cmd.c
>   (print_info_xml, print_info): Show move information in wc info, if any.
> 
> * subversion/svn/schema/info.rnc
>   (wc-info): Add moved-from and moved-to tags.
> 
> * subversion/libsvn_wc/info.c
>   (svn_wc_info_dup): Dup the new fields.
>   (build_info_for_node): Obtain move information from DB and put it into
>    the returned wc-info structure.
> 
> Modified:
>     subversion/trunk/subversion/include/svn_wc.h
>     subversion/trunk/subversion/libsvn_wc/info.c
>     subversion/trunk/subversion/svn/info-cmd.c
>     subversion/trunk/subversion/svn/schema/info.rnc
> 
> Modified: subversion/trunk/subversion/include/svn_wc.h
> URL:
> http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc
> .h?rev=1155001&r1=1155000&r2=1155001&view=diff
> ==========================================================
> ====================
> --- subversion/trunk/subversion/include/svn_wc.h (original)
> +++ subversion/trunk/subversion/include/svn_wc.h Mon Aug  8 16:05:24
> 2011
> @@ -3068,6 +3068,15 @@ typedef struct svn_wc_info_t
>    /** The local absolute path of the working copy root.  */
>    const char *wcroot_abspath;
> 
> +  /** The path the node was moved from, if it was moved here. Else NULL.
> +   * This path is relative to the working copy root.
> +   * @since New in 1.8. */
> +  const char *moved_from_relpath;
> +
> +  /** The path the node was moved to, if it was moved away. Else NULL.
> +   * This path is relative to the working copy root.
> +   * @since New in 1.8. */
> +  const char *moved_to_relpath;
>  } svn_wc_info_t;

I think the api should just provide abspaths here, like we do in all new in 1.7+ wc apis. 
The client - in this case 'svn'- can then decide what to do with the path.
 
	Bert


Re: svn commit: r1155001 - in /subversion/trunk/subversion: include/svn_wc.h libsvn_wc/info.c svn/info-cmd.c svn/schema/info.rnc

Posted by Stefan Sperling <st...@elego.de>.
On Mon, Aug 08, 2011 at 06:11:42PM +0200, Bert Huijben wrote:
> 
> 
> > -----Original Message-----
> > From: stsp@apache.org [mailto:stsp@apache.org]
> > Sent: maandag 8 augustus 2011 18:05
> > To: commits@subversion.apache.org
> > Subject: svn commit: r1155001 - in /subversion/trunk/subversion:
> > include/svn_wc.h libsvn_wc/info.c svn/info-cmd.c svn/schema/info.rnc
> > 
> > Author: stsp
> > Date: Mon Aug  8 16:05:24 2011
> > New Revision: 1155001
> > 
> > URL: http://svn.apache.org/viewvc?rev=1155001&view=rev
> > Log:
> > Show moved-to/moved-from information in 'svn info' output.
> > 
> > * subversion/include/svn_wc.h
> >   (svn_wc_info_t): New fields MOVED_FROM_RELPATH and
> > MOVED_TO_RELPATH.
> > 
> > * subversion/svn/info-cmd.c
> >   (print_info_xml, print_info): Show move information in wc info, if any.
> > 
> > * subversion/svn/schema/info.rnc
> >   (wc-info): Add moved-from and moved-to tags.
> > 
> > * subversion/libsvn_wc/info.c
> >   (svn_wc_info_dup): Dup the new fields.
> >   (build_info_for_node): Obtain move information from DB and put it into
> >    the returned wc-info structure.
> > 
> > Modified:
> >     subversion/trunk/subversion/include/svn_wc.h
> >     subversion/trunk/subversion/libsvn_wc/info.c
> >     subversion/trunk/subversion/svn/info-cmd.c
> >     subversion/trunk/subversion/svn/schema/info.rnc
> > 
> > Modified: subversion/trunk/subversion/include/svn_wc.h
> > URL:
> > http://svn.apache.org/viewvc/subversion/trunk/subversion/include/svn_wc
> > .h?rev=1155001&r1=1155000&r2=1155001&view=diff
> > ==========================================================
> > ====================
> > --- subversion/trunk/subversion/include/svn_wc.h (original)
> > +++ subversion/trunk/subversion/include/svn_wc.h Mon Aug  8 16:05:24
> > 2011
> > @@ -3068,6 +3068,15 @@ typedef struct svn_wc_info_t
> >    /** The local absolute path of the working copy root.  */
> >    const char *wcroot_abspath;
> > 
> > +  /** The path the node was moved from, if it was moved here. Else NULL.
> > +   * This path is relative to the working copy root.
> > +   * @since New in 1.8. */
> > +  const char *moved_from_relpath;
> > +
> > +  /** The path the node was moved to, if it was moved away. Else NULL.
> > +   * This path is relative to the working copy root.
> > +   * @since New in 1.8. */
> > +  const char *moved_to_relpath;
> >  } svn_wc_info_t;
> 
> I think the api should just provide abspaths here, like we do in all new in 1.7+ wc apis. 
> The client - in this case 'svn'- can then decide what to do with the path.

I thought about this, too. I decided to use relpaths mainly because
the wc-info struct pertains to a single working copy (it has a single
wcroot_abspath member).

We'd only need abspaths here to express moves between different working
copies. For now, details of how we would implement this are unclear to
me. It seems like a lot more work would be needed to support this anyway.
Even the queries we use at the DB storage layer don't support this right now.
So I like the idea of having the current API implicitly enforce this
restriction.

That said, I see a point in making the APIs future proof.
But we can always add new members to the struct (e.g. moved_from_abspath)
when the time is ready and we understand all of what is needed to support
moves across different working copies.