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

Re: switch --relocate fails on deleted dir in mixed-rev WC

From: Philip Martin <philip_at_codematters.co.uk>
Date: 2005-10-12 13:53:45 CEST

Julian Foad <julianfoad@btopenworld.com> writes:

> Philip Martin wrote:
>> Julian Foad <julianfoad@btopenworld.com> writes:
>>
>>>- if (recurse && (entry->kind == svn_node_dir))
>>>+ if (recurse && (entry->kind == svn_node_dir)
>>>+ && ((! entry->deleted && ! entry->absent)
>>>+ || (entry->schedule == svn_wc_schedule_add)
>>>+ || (entry->schedule == svn_wc_schedule_replace)))
>>> {
>>> svn_wc_adm_access_t *subdir_access;
>>> const char *subdir = svn_path_join (path, key, pool);
>>>
>>>I'm rather unsure of the exact meanings and combinations of "absent"
>>>and "deleted" and "schedule", and am worried by other bits of code
>>>using different tests such as the following:
>> 'schedule="delete"' indicates that an existing item will be deleted
>> at
>> the next commit, think 'svn rm wc/foo'.
>> 'schedule="add"' indicates that a new item will be added at the next
>> commit, think 'svn add wc/foo'.
>> 'schedule="replace"' indicates both of the above, think 'svn rm
>> wc/foo'
>> followed by 'svn add wc/foo'.
>> 'deleted="true"' indicates that the entry was scheduled for deletion
>> and subsequently committed, but that the parent directory has not been
>> updated and so is at a revision that would otherwise contain the
>> deleted item, think 'svn rm wc/foo' followed by 'svn ci wc'
>> 'absent="true"' indicates that mod_authz_svn doesn't allow read
>> access
>> to that item so it's not physically present in the working copy.
>
> Yes, their individual meanings all sound simple enough at first
> reading, but in combination, how, for instance, do you get a directory
> "deleted" with "schedule=replace"?

"deleted" with "schedule=replace" would be a bug, it should not occur.

>> Your change looks correct to me.

But you are right, I was probably a bit hasty. "absent" is often
treated very much like "deleted" in the existing code, but as far as I
know "absent" can't be deleted or added and so can never be
"schedule=anything". Your code probably has redundant checks.

The code should avoid recursing if "absent" since such items can never
be present on disk. The code should avoid recursing if "deleted"
unless "schedule=add". So I think that makes it:

      if (recurse && entry->kind == svn_node_dir
          && ! entry->absent
          && (! entry->deleted || entry->schedule == svn_wc_schedule_add))

-- 
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Oct 12 13:54:36 2005

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.