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

Re: [PATCH] wc-ng - Remove use of entry_t from calculate_target_mergeinfo

From: Greg Stein <gstein_at_gmail.com>
Date: Tue, 2 Mar 2010 07:29:07 -0500

On Tue, Mar 2, 2010 at 05:39, Philip Martin <philip.martin_at_wandisco.com> wrote:
> Matthew Bentham <mjb67_at_artvps.com> writes:
>
>>  static svn_error_t *
>>  calculate_target_mergeinfo(svn_ra_session_t *ra_session,
>>                             apr_hash_t **target_mergeinfo,
>>                             svn_wc_adm_access_t *adm_access,
>>                             const char *src_path_or_url,
>>                             svn_revnum_t src_revnum,
>> -                           svn_boolean_t no_repos_access,
>>                             svn_client_ctx_t *ctx,
>>                             apr_pool_t *pool)
>>  {
>> -  const svn_wc_entry_t *entry = NULL;
>>    svn_boolean_t locally_added = FALSE;
>>    const char *src_url;
>>    apr_hash_t *src_mergeinfo = NULL;
>> @@ -94,13 +90,15 @@
>>       bother checking. */
>>    if (adm_access)
>>      {
>> +      svn_boolean_t added, copied;
>>        const char *local_abspath;
>>
>>        SVN_ERR(svn_dirent_get_absolute(&local_abspath, src_path_or_url, pool));
>> -      SVN_ERR(svn_wc__get_entry_versioned(&entry, ctx->wc_ctx, local_abspath,
>> -                                          svn_node_unknown, FALSE, FALSE,
>> -                                          pool, pool));
>> -      if (entry->schedule == svn_wc_schedule_add && (! entry->copied))
>> +      SVN_ERR(svn_wc__node_is_status_added(&added, ctx->wc_ctx,
>> +                                           local_abspath, pool));
>> +      SVN_ERR(svn_wc__node_is_status_copied(&copied, ctx->wc_ctx,
>> +                                           local_abspath, pool));
>
> It looks a bit odd to call _added just before _copied when _copied
> itself calls _added.
>
>> +      if (added && !copied)
>>          {
>>            locally_added = TRUE;
>>          }
>
>> +svn_wc__node_is_status_copied(svn_boolean_t *is_copied,
>> +                              svn_wc_context_t *wc_ctx,
>> +                              const char *local_abspath,
>> +                              apr_pool_t *scratch_pool)
>> +{
>> +  svn_wc__db_status_t status;
>> +  svn_boolean_t added;
>> +
>> +  SVN_ERR(svn_wc__node_is_status_added(&added, wc_ctx, local_abspath,
>> +                                scratch_pool));
>> +  if (!added)
>> +    {
>> +      *is_copied = FALSE;
>> +      return SVN_NO_ERROR;
>> +    }
>> +
>> +  SVN_ERR(svn_wc__db_scan_addition(&status,
>> +                                NULL, NULL, NULL, NULL,
>> +                                NULL, NULL, NULL, NULL,
>> +                                wc_ctx->db, local_abspath,
>> +                                scratch_pool, scratch_pool));
>> +  *is_copied = (status == svn_wc__db_status_copied);
>
> What about svn_wc__db_status_moved_here?  That's a copy where the
> source happened to be deleted as well.  What should _is_status_copied
> return?  How should calculate_target_mergeinfo handle _moved_here?
> Like copied or like added?

The "node" functions will *hopefully* not survive to the 1.7 release.
Their intent is merely to provide a stopgap measure between "the world
of entries" and "the world of wc-ng". Getting us away from entry_t is
higher priority than getting a perfect reimplementation within terms
of wc_db and friends.

Thus, the notion of moved_here is not all that relevant because I
would hope this function won't survive to the point where we start
recording moves in wc_db (so, thus, we'll never record/generate that
status).

Once we lose all refs to entry_t, there is a lot of
compat/infrastructure that can be ripped out to *really* clean up our
code, and allow us to start moving forward with new kinds of progress.
But we will also need to come back to either rip/rebuild "node"-based
code, or to formalize the semantics of those functions.

Note that ^/trunk/tools/dev/wc-ng/count-progress.py includes
references to the node functions as something to eliminate "before
release".

Cheers,
-g
Received on 2010-03-02 13:29:40 CET

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