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

Re: Right place for cleaning up entries fields on delete

From: Erik Huelsmann <ehuels_at_gmail.com>
Date: 2005-09-22 22:53:20 CEST

On 9/22/05, Philip Martin <philip@codematters.co.uk> wrote:
> Ivan Zhakov <chemodax@gmail.com> writes:
>
> > I am fixing deletion of replaced files in working copy (in
> > wc-replacements branch). When file replaced it has copyfrom-url,
> > copyfrom-rev and copied fields set. But when file gets deleted these
> > fields should be cleared, am I right?
>
> Just to check I understand you, something like:
>
> $ svn rm foo
> $ svn cp URL foo
> $ svn rm --force foo
>
> > Next question where this logic should be implemented. I have found two
> > places where this could be done:
> > 1. In subversion/libsvn_wc/adm_ops:svn_wc_delete2() when we going to
> > modify schedule field also modify copyfrom-url and copyfrom-rev
> > fields.
>
> There are already a number of places where the wc code is not atomic
> and probably should be. I think this might be adding another.

Ok. I think you are saying this should all be loggy operations, right?
Do you consider it a task of wc-replacements to get this right, or is
that a separate issue to you? (which would -of course- include fixing
the other ones too)

BTW: which part of the 'remove copyfrom-url and copyfrom-rev' do you
consider non-atomic? Modifying an entry is done with 1 call into
svn_wc__modify_entry.

> > 2. Another place that I found is
> > subversion/libsvn_wc/entries.c:fold_scheduling(). In this place
> > already implemented similiar logic for discard entry on delete if
> > before it was added.
>
> fold_scheduling looks a little bit odd to me, how about doing it in
> svn_wc__entry_modify.

That seems the place to do it.

Ivan, note that we also need to copy the text-revert and optional
prop-revert files over the text-base and prop-base files. That's
something which I think does belong in svn_wc_delete2().

bye,

Erik.
Received on Thu Sep 22 22:54:00 2005

This is an archived mail posted to the Subversion Dev mailing list.