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

Re: your question about schedule_replace

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Fri, 16 Oct 2009 10:35:10 +0100

Greg Stein wrote:
> svn_error_t *
> svn_wc__internal_is_replaced(svn_boolean_t *replaced,
> svn_wc__db_t *db,
> const char *local_abspath,
> apr_pool_t *scratch_pool)
>
> It is equivalent to the wc-1 concept of:
>
> *replaced = entry->schedule == svn_wc_schedule_replace;

Examining this function provides me with an opportunity to learn
something more about WC-NG.

Here's the bare bones, stripped of error handling, pools and extra NULL
arguments:

/* Equivalent to the old notion of "entry->schedule == schedule_replace"
*/
svn_wc__internal_is_replaced(svn_boolean_t *replaced,
                             svn_wc__db_t *db,
                             const char *local_abspath)
{
  svn_wc__db_status_t status;
  svn_boolean_t base_shadowed;
  svn_wc__db_status_t base_status;

  svn_wc__db_read_info(&status, &base_shadowed,
                       db, local_abspath);
  if (base_shadowed)
    svn_wc__db_base_get_info(&base_status,
                             db, local_abspath);

  *replaced = ((status == svn_wc__db_status_added
                || status == svn_wc__db_status_obstructed_add)
               && base_shadowed
               && base_status != svn_wc__db_status_not_present);
}

The main point seems to be the "base_shadowed" indication. I guess that
means something like "scheduled for replacement".

What is the significance of "base_status != not_present"?

What is the significance of "status" being add or obstructed_add? I
would have thought that, if any qualification were needed on top of
"shadowed", it would be "added or copied-to or moved-to".

- Julian

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2408169
Received on 2009-10-16 11:35:41 CEST

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.