You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Rui, Guo" <ti...@mail.ustc.edu.cn> on 2008/08/15 14:53:22 UTC
Re: In which situation will a deleted item be scheduled
add/replace?
On Fri, Aug 15, 2008 at 03:20:38PM +0100, Philip Martin wrote:
> "Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
>
> > I find some condition tests in libsvn_wc code base like this:
> > (! entry->deleted || (entry->schedule == svn_wc_schedule_add))
> >
> > This kind of code appears in relocate.c and entries.c etc. Reading
> > the code, I think it is used to catch a situation of both the
> > excluded and add/replace schedule being set up for a single
> > entry.
>
> It occurs in mixed revision working copies. entry->deleted gets set
> when a svn_wc_schedule_delete item is committed without a change to
> the parent directory. Since that doesn't change the parent
> directory's revision the entries file retains an entry for the deleted
> item until a subsequent update.
>
> $ svn co URL wc
> $ svn rm wc/some_file
> $ svn ci wc # some_file has entry->deleted set
> $ touch wc/some_file
> $ svn add wc/some_file # some_file is also svn_wc_schedule_add
Are you sure? My experiment shows the add will fail.
Rui
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: In which situation will a deleted item be scheduled add/replace?
Posted by Philip Martin <ph...@codematters.co.uk>.
"Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
>> > Does this bug deserve a fix? It seems not very harmful.
>> I'd say yes, but I'm not planning to do it :)
> Me neither :)
It's now issue 3263.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: In which situation will a deleted item be scheduled
add/replace?
Posted by "Rui, Guo" <ti...@mail.ustc.edu.cn>.
On Sat, Aug 16, 2008 at 10:09:13AM +0100, Philip Martin wrote:
> "Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
>
> > On Fri, Aug 15, 2008 at 05:59:30PM +0100, Philip Martin wrote:
> >> That looks like a bug.
> >>
> >> svnadmin create repo
> >> svn co file://`pwd`/repo wc
> >> touch wc/foo wc/bar
> >> svn add wc/foo wc/bar
> >> svn ci -mm wc
> >> svn up wc
> >> svn rm wc/foo
> >> svn ci -mm wc # foo is entry->deleted
> >> svn cp wc/bar wc/foo # BUG! foo is not entry->deleted
> >> svn revert wc/foo
> >> svn up -r1 wc
> > And if you try without '-r1' instead, the update will simply fail.
>
> Is that because revert leaves an unversioned wc/foo? I forgot to show
> 'rm wc/foo' after the revert; it's possible that that is a revert bug
> and that the copy should not count as a local modification.
No, I did remove the foo before an update. The revert just cause the record of
foo in the .entries file go away. As a result, the foo looks like a totally
unversioned item in the wc and will cause problem in later update. But I don't
think revert is the one to blame. The root of the problem is still the one
you have figured out.
>
> >>
> >> The last update should restore wc/foo but the copy bug means it
> >> doesn't happen.
> >
> > Does this bug deserve a fix? It seems not very harmful.
>
> I'd say yes, but I'm not planning to do it :)
Me neither :)
Now, add+deleted is not a problem for me. And I digged into the code a bit
about replace. I find that it means a scheduled-delete plus a scheduled-add. I
think the scheduled-delete and deleted flag can not happen at the same time.
If that's the truth, testing against (!entry->deleted || entry->schedule ==
svn_wc_schedule_replace) is meaningless. Right? On the other hand, if the
situation can happen, some code will have to be fixed, since they only cover
the situation of 'add'.
Rui
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: In which situation will a deleted item be scheduled add/replace?
Posted by Philip Martin <ph...@codematters.co.uk>.
"Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
> On Fri, Aug 15, 2008 at 05:59:30PM +0100, Philip Martin wrote:
>> That looks like a bug.
>>
>> svnadmin create repo
>> svn co file://`pwd`/repo wc
>> touch wc/foo wc/bar
>> svn add wc/foo wc/bar
>> svn ci -mm wc
>> svn up wc
>> svn rm wc/foo
>> svn ci -mm wc # foo is entry->deleted
>> svn cp wc/bar wc/foo # BUG! foo is not entry->deleted
>> svn revert wc/foo
>> svn up -r1 wc
> And if you try without '-r1' instead, the update will simply fail.
Is that because revert leaves an unversioned wc/foo? I forgot to show
'rm wc/foo' after the revert; it's possible that that is a revert bug
and that the copy should not count as a local modification.
>>
>> The last update should restore wc/foo but the copy bug means it
>> doesn't happen.
>
> Does this bug deserve a fix? It seems not very harmful.
I'd say yes, but I'm not planning to do it :)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: In which situation will a deleted item be scheduled
add/replace?
Posted by "Rui, Guo" <ti...@mail.ustc.edu.cn>.
On Fri, Aug 15, 2008 at 05:59:30PM +0100, Philip Martin wrote:
> "Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
>
> > On Fri, Aug 15, 2008 at 04:23:44PM +0100, Philip Martin wrote:
> >> "Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
> >>
> >> > On Fri, Aug 15, 2008 at 03:20:38PM +0100, Philip Martin wrote:
> >> >> $ svn co URL wc
> >> >> $ svn rm wc/some_file
> >> >> $ svn ci wc # some_file has entry->deleted set
> >> >> $ touch wc/some_file
> >> >> $ svn add wc/some_file # some_file is also svn_wc_schedule_add
> >> > Are you sure? My experiment shows the add will fail.
> >>
> >> It should work, look at update_after_add_rm_deleted in the
> >> update_tests.py regression tests for an example.
> > Sorry. I used a file instead and resulted in failure.
> >
> > So if the Add command will lead to both deleted&scheduled add, why does
> > copy/move clear the deleted flag?
>
> That looks like a bug.
>
> svnadmin create repo
> svn co file://`pwd`/repo wc
> touch wc/foo wc/bar
> svn add wc/foo wc/bar
> svn ci -mm wc
> svn up wc
> svn rm wc/foo
> svn ci -mm wc # foo is entry->deleted
> svn cp wc/bar wc/foo # BUG! foo is not entry->deleted
> svn revert wc/foo
> svn up -r1 wc
And if you try without '-r1' instead, the update will simply fail.
>
> The last update should restore wc/foo but the copy bug means it
> doesn't happen.
Does this bug deserve a fix? It seems not very harmful.
Rui
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: In which situation will a deleted item be scheduled add/replace?
Posted by Philip Martin <ph...@codematters.co.uk>.
"Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
> On Fri, Aug 15, 2008 at 04:23:44PM +0100, Philip Martin wrote:
>> "Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
>>
>> > On Fri, Aug 15, 2008 at 03:20:38PM +0100, Philip Martin wrote:
>> >> $ svn co URL wc
>> >> $ svn rm wc/some_file
>> >> $ svn ci wc # some_file has entry->deleted set
>> >> $ touch wc/some_file
>> >> $ svn add wc/some_file # some_file is also svn_wc_schedule_add
>> > Are you sure? My experiment shows the add will fail.
>>
>> It should work, look at update_after_add_rm_deleted in the
>> update_tests.py regression tests for an example.
> Sorry. I used a file instead and resulted in failure.
>
> So if the Add command will lead to both deleted&scheduled add, why does
> copy/move clear the deleted flag?
That looks like a bug.
svnadmin create repo
svn co file://`pwd`/repo wc
touch wc/foo wc/bar
svn add wc/foo wc/bar
svn ci -mm wc
svn up wc
svn rm wc/foo
svn ci -mm wc # foo is entry->deleted
svn cp wc/bar wc/foo # BUG! foo is not entry->deleted
svn revert wc/foo
svn up -r1 wc
The last update should restore wc/foo but the copy bug means it
doesn't happen.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: In which situation will a deleted item be scheduled
add/replace?
Posted by "Rui, Guo" <ti...@mail.ustc.edu.cn>.
On Fri, Aug 15, 2008 at 04:23:44PM +0100, Philip Martin wrote:
> "Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
>
> > On Fri, Aug 15, 2008 at 03:20:38PM +0100, Philip Martin wrote:
> >> $ svn co URL wc
> >> $ svn rm wc/some_file
> >> $ svn ci wc # some_file has entry->deleted set
> >> $ touch wc/some_file
> >> $ svn add wc/some_file # some_file is also svn_wc_schedule_add
> > Are you sure? My experiment shows the add will fail.
>
> It should work, look at update_after_add_rm_deleted in the
> update_tests.py regression tests for an example.
Sorry. I used a file instead and resulted in failure.
So if the Add command will lead to both deleted&scheduled add, why does
copy/move clear the deleted flag?
Thanks,
Rui
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: In which situation will a deleted item be scheduled add/replace?
Posted by Philip Martin <ph...@codematters.co.uk>.
"Rui, Guo" <ti...@mail.ustc.edu.cn> writes:
> On Fri, Aug 15, 2008 at 03:20:38PM +0100, Philip Martin wrote:
>> $ svn co URL wc
>> $ svn rm wc/some_file
>> $ svn ci wc # some_file has entry->deleted set
>> $ touch wc/some_file
>> $ svn add wc/some_file # some_file is also svn_wc_schedule_add
> Are you sure? My experiment shows the add will fail.
It should work, look at update_after_add_rm_deleted in the
update_tests.py regression tests for an example.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org