[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: Ivan Zhakov <chemodax_at_gmail.com>
Date: 2005-09-23 00:20:07 CEST

On 9/23/05, Erik Huelsmann <ehuels@gmail.com> wrote:
> 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)
Agreed with Erik that atomic problems should be solved separately. Of
course new code should be done without introducing new atomic

> 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.
I have doubt about this. At this time svn_wc__entry_modify doesn't
have such code. And adding such intelligence to deep function possibly
change behavior in many places. Might this is just paranoia.

> 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().
I know about copy text-revert and prop-revert. I am fixing problems by
small steps. As the frist step I'll fix deletion itself (my
copy_tests.py 35). For this I need only cleanup fields.
As next step I'll fix reverting and for this I need copy revert files
back to base. I haven't question where second thing should be done --
my opinion in svn_wc_delete2()

Ivan Zhakov
Received on Fri Sep 23 00:21:03 2005

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