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

Re: [PATCH] svn_wc_relocate3() on deleted target.

From: Rui, Guo <timmyguo_at_mail.ustc.edu.cn>
Date: Tue, 22 Jul 2008 11:58:24 +0800

How about this?

[[[

Fix the prolbem demonstrated below:
svn co http://server/greek_tree wc
cd wc/A
svn rm D
svn ci D -m 'rm D'
svn sw --relocate from to D

These results in exception:
subversion/libsvn_wc/lock.c:997: (apr_err=155005)
svn: Directory 'D/C' is missing

* subversion/libsvn_wc/relocate.c
  (svn_wc_relocate3): Relocate deleted entry as a single entry.

]]]

Rui
On Mon, Jul 21, 2008 at 07:30:18PM -0400, Karl Fogel wrote:
> "Rui, Guo" <timmyguo_at_mail.ustc.edu.cn> writes:
> > I present this patch to fix a small problem, demonstrated in the following
> > command sequence:
> >
> > svn co http://server/greek_tree wc
> > cd wc/A
> > svn rm D
> > svn ci D -m 'rm D'
> > svn sw --relocate from to D
> >
> > These results in exception:
> > subversion/libsvn_wc/lock.c:997: (apr_err=155005)
> > svn: Directory 'D/C' is missing
> >
> > [[[
> > * subversion/libsvn_wc/relocate.c
> > (svn_wc_relocate3): Relocate deleted entry as a single entry.
> > ]]]
>
> Thanks!
>
> Since there's no issue filed for this, the log message should probably
> give the reproduction recipe.
>
> > I'm not sure how to deal with absent entry in this situation. But they usually
> > appears together in the testing condition. And when testing against
> > entry->deleted, somethings the svn_wc_schedule_replace is also checked. I saw
> > some of this in the code, but not always. This is suspicious in my mind.
> > Should I also check svn_wc_schedule_replace here?
>
> I think so. Because if the subdir is scheduled for replacement, then a
> relocate would have to descend into it -- it can't be handled as a
> single entry.
>
> An absent entry should also be relocated; see the documentation of the
> 'absent' field in svn_wc_entry_t.
>
> -Karl
>
> > Index: subversion/libsvn_wc/relocate.c
> > ===================================================================
> > --- subversion/libsvn_wc/relocate.c (revision 32140)
> > +++ subversion/libsvn_wc/relocate.c (working copy)
> > @@ -128,7 +128,8 @@
> > if (! entry)
> > return svn_error_create(SVN_ERR_ENTRY_NOT_FOUND, NULL, NULL);
> >
> > - if (entry->kind == svn_node_file)
> > + if (entry->kind == svn_node_file
> > + || ( entry->deleted && (entry->schedule != svn_wc_schedule_add)))
> > {
> > SVN_ERR(relocate_entry(adm_access, entry, from, to,
> > validator, validator_baton, TRUE /* sync */,
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
> For additional commands, e-mail: dev-help_at_subversion.tigris.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe_at_subversion.tigris.org
For additional commands, e-mail: dev-help_at_subversion.tigris.org

Received on 2008-07-22 05:58:40 CEST

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.