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

Re: [PATCH] svnsync 1.6 works even when source has eol-style impurities

From: B. Smith-Mannschott <bsmith.occs_at_gmail.com>
Date: Mon, 27 Apr 2009 22:11:28 +0200

I spent the past weekend reading though the every line of
svnsync/main.c on paper. This was a great help. I've made good
progress on patching #3404. I *think* I've finished something
submittable, but I need to let it sit a day and then run it through a
few test scenarios before I post it. In the meantime, perhaps you
could clear something up for me:
Can I call apr_hash_set in this way during traversal, or is this a Bad Thing?

/* normalize the eol-style of the values of those svn: properties in
   in rev_props which need_translation. */
static svn_error_t *
normalize_revprop_eol_style(apr_hash_t *rev_props, apr_pool_t *pool)
{
  apr_hash_index_t *hi;

  for (hi = apr_hash_first(pool, rev_props);
       hi;
       hi = apr_hash_next(hi))
    {
      const void *key;
      void *val;

      apr_hash_this(hi, &key, NULL, &val);

      if (svn_prop_needs_translation(key))
        {
          SVN_ERR(normalize_svn_string_eol_style((const svn_string_t **)&val,
                                                 pool));
          /* http://apr.apache.org/docs/apr/0.9/group__apr__hash.html
             doesn't say if it's safe to replace the value of an
             already present key. Here's hoping that it is... */
          apr_hash_set(rev_props, key, APR_HASH_KEY_STRING, val);
        }
    }
  return SVN_NO_ERROR;
}

// Ben

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=1951259
Received on 2009-04-27 22:11:52 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.