FreeBSD/contrib/subversion/subversion/libsvn_repos/load-fs-vtable.c
/* Prepend the mergeinfo source paths in MERGEINFO_ORIG with PARENT_DIR, and
   return it in *MERGEINFO_VAL. */
Prepend the mergeinfo source paths in MERGEINFO_ORIG with PARENT_DIR, and
return it in *MERGEINFO_VAL.
Prepend the mergeinfo source paths in MERGEINFO_ORIG with PARENT_DIR and return it in * MERGEINFO_VAL .
static svn_error_t *
prefix_mergeinfo_paths(svn_string_t **mergeinfo_val,
                       const svn_string_t *mergeinfo_orig,
                       const char *parent_dir,
                       apr_pool_t *pool)
{
  apr_hash_t *prefixed_mergeinfo, *mergeinfo;
  apr_hash_index_t *hi;
  SVN_ERR(svn_mergeinfo_parse(&mergeinfo, mergeinfo_orig->data, pool));
  prefixed_mergeinfo = apr_hash_make(pool);
  for (hi = apr_hash_first(pool, mergeinfo); hi; hi = apr_hash_next(hi))
    {
      const char *merge_source = apr_hash_this_key(hi);
      svn_rangelist_t *rangelist = apr_hash_this_val(hi);
      const char *path;
      merge_source = svn_relpath_canonicalize(merge_source, pool);
      path = svn_fspath__canonicalize(svn_relpath_join(parent_dir,
                                                       merge_source, pool),
                                      pool);
      svn_hash_sets(prefixed_mergeinfo, path, rangelist);
    }
  return svn_mergeinfo_to_string(mergeinfo_val, prefixed_mergeinfo, pool);
}
static svn_error_t * prefix_mergeinfo_paths ( svn_string_t * * mergeinfo_val , const svn_string_t * mergeinfo_orig , const char * parent_dir , apr_pool_t * pool ) { apr_hash_t * prefixed_mergeinfo , * mergeinfo ; apr_hash_index_t * hi ; SVN_ERR ( svn_mergeinfo_parse ( & mergeinfo , mergeinfo_orig -> data , pool ) ) ; prefixed_mergeinfo = apr_hash_make ( pool ) ; for ( hi = apr_hash_first ( pool , mergeinfo ) ; hi ; hi = apr_hash_next ( hi ) ) { const char * merge_source = apr_hash_this_key ( hi ) ; svn_rangelist_t * rangelist = apr_hash_this_val ( hi ) ; const char * path ; merge_source = svn_relpath_canonicalize ( merge_source , pool ) ; path = svn_fspath__canonicalize ( svn_relpath_join ( parent_dir , merge_source , pool ) , pool ) ; svn_hash_sets ( prefixed_mergeinfo , path , rangelist ) ; } return svn_mergeinfo_to_string ( mergeinfo_val , prefixed_mergeinfo , pool ) ; }
Prepend the mergeinfo source paths in MERGEINFO_ORIG with PARENT_DIR, and
return it in *MERGEINFO_VAL.
Prepend the mergeinfo source paths in MERGEINFO_ORIG with PARENT_DIR and return it in * MERGEINFO_VAL .
/* The svn:mergeinfo property syntax demands a repos abspath */