Login | Register
My pages Projects Community openCollabNet

Discussions > dev [DISABLED] > Re: [PATCH] Replace svn_path_join() in libsvn_client/mergeinfo.c

subversion
Discussion topic

Back to topic list

Re: [PATCH] Replace svn_path_join() in libsvn_client/mergeinfo.c

Author dlr
Full name Daniel Rall
Date 2009-11-06 13:57:53 PST
Message On Fri, Nov 6, 2009 at 10:39 AM, Daniel Näslund <daniel at longitudo dot com> wrote:
> [[[
> Replace svn_path_join() since there are conflicting definitions of a
> path.
>
> * subversion/libsvn_cl​ient/mergeinfo.c
>  (svn_client__adjust​_mergeinfo_source_pa​ths): Replace svn_path_join()
>    with svn_dirent_join(). The base is a key in svn_mergeinfo_t.
>  (svn_client__get_wc​_mergeinfo): Replace svn_path_join() with
>    svn_relpath_join(). The base is created with svn_dirent_basename()
>    that returns a relative path.
>  (svn_client_mergein​fo_get_merged): Replace svn_path_join() with
>    svn_uri_join(). We want to create full urls of svn_mergeinfo_t keys.
>
> Patch by: Daniel Näslund <daniel at longitudo dot com>
> ]]]
>
> Some background: In subversion/include/s​vn_mergeinfo.h svn_mergeinfo_t
> is just a typedef for a apr_hash_t. The keys are described like this:
>
>  * (c) @c svn_mergeinfo_t, called "mergeinfo".  A hash mapping merge
>  *     source paths (@c const char *, starting with slashes) to
>  *     non-empty rangelist arrays.  A @c NULL hash is used to represent
>  *     no mergeinfo and an empty hash is used to represent empty
>  *     mergeinfo.
>
> I'm assuming that means a dirent.

It's a path fragment. In this case, the path is relative to the
repository root. While you may be able to use it as a local file
system path in some situations, it's really a URL fragment.

> If the keys in svn_mergeinfo_t is a dirent then in
> svn_client_mergeinfo​_get_merged() we create an url from a dirent.
>
> svn_dirent_uri.h says:
>
>  * When translating between local paths (dirents) and uris code should
>  * always go via the relative path format.
>  * E.g.
>  *  - by truncating a parent portion from a path with svn_*_skip_ancestor(),
>  *  - or by converting portions to basenames and then joining to existing paths.
>
> But in svn_wc__node_get_base_rev() we just skip the leading '/' in the
> join. It's shorter and easier to understand than using
> svn_dirent_skip_ancestor() and svn_dirent_basename. So I let it stay
> that way.
>
> /Daniel
>

« Previous message in topic | 3 of 7 | Next message in topic »

Messages

Show all messages in topic

[PATCH] Replace svn_path_join() in libsvn_client/mergeinfo.c dannas Daniel Näslund 2009-11-06 10:39:33 PST
     Re: [PATCH] Replace svn_path_join() in libsvn_client/mergeinfo.c dannas Daniel Näslund 2009-11-06 13:22:35 PST
     Re: [PATCH] Replace svn_path_join() in libsvn_client/mergeinfo.c dlr Daniel Rall 2009-11-06 13:57:53 PST
         [PATCH v2] Replace svn_path_join() in libsvn_client/mergeinfo.c dannas Daniel Näslund 2009-11-07 04:23:06 PST
             Re: [PATCH v2] Replace svn_path_join() in libsvn_client/mergeinfo.c julianfoad Julian Foad 2009-11-10 04:37:18 PST
                 Re: [PATCH v2] Replace svn_path_join() in libsvn_client/mergeinfo.c dannas Daniel Näslund 2009-11-10 04:44:23 PST
                     Re: [PATCH v2] Replace svn_path_join() in libsvn_client/mergeinfo.c julianfoad Julian Foad 2009-11-10 06:47:43 PST
Messages per page: