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 13:47:45 UTC

In which situation will a deleted item be scheduled add/replace?

Hi,

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. This sounds reasonable since the
user may remove an existing item and introduce a new one with a same name.
However, all my attempts to produce a sample of this situation end up as
failures. Copy/Move will clean the deleted flag and add will refuse to proceed
if the target is deleted. So, is this a historical code and the combination of
these two flags is prohibited now?

(PS: I found a small corner case during my little experiments. Remove a directory
A; commit A; Copy some B into A; revert A and finally update the whole tree
and you'll get a error talking about A is not under version control. A second
update attempt will make things back to normal. Nothing harmful will happen.)

Another small question: When will the svn_wc_schedule_replace flag being used?
I remember seeing add rather than replace all the time.

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:

> 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

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org