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

Re: Cannot use svn_relpath_join() for path created in svn_client__path_relative_to_root()

From: Daniel Näslund <daniel_at_longitudo.com>
Date: Fri, 6 Nov 2009 15:22:29 +0100

On Fri, Nov 06, 2009 at 02:33:44PM +0100, Daniel Näslund wrote:
> Hi!
>
> When trying to replace svn_path_join() in libvn_client/merge.c I for
> some reasson cannot use svn_relpath_join() with a path created in
> svn_client_path__relative_to_root() as base.
>
> * libsvn_client/merge.c
> (do_directory_merge): Creates mergeinfo_path with a call to
> svn_client__path_relative_to_root(). Calls
> record_mergeinfo_for_dir_merge().
>
> * libsvn_client/merge.c
> (record_mergeinfo_for_dir_merge): Contains the following snippet
> starting on line 6906. If I replace svn_path_join() with svn_uri_join()
> everything works fine but if I use svn_relpath_join() then shabang!
> Almost every merge_test fails.

svn_dirent_uri.h says this:
[[[

 * - a URI is an absolute path that starts with a '/' or a schema definition.
 * Examples: "/", "/foo", "http://server", "svn+ssh://user@host:123/file"
 * But not: "file", "dir/file", "A:/dir"
 * ### Currently the URI implementation still allows relpaths as valid
 * uris, but this will change soon.
 *
 * - a relative path (relpath) is an unrooted path that can be joined to
 * any other relative path, uri or dirent. A relative path is never
 * rooted/prefixed by a '/'.
 * Examples: "file", "dir/file", "dir/subdir/../file"
 * But not: "/file", "http://server/file"
]]]

So 'path relative to root' really is an absolute path! Doh! Double doh!
The doc string of record_mergeinfo_for_dir_merge() called mergeinfo_path
a repository relative path. I saw the same things in other places. I
propose that we use another naming strategy for paths that is relative
to the repository root! Why not absolute to the repository root?

/Daniel

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2415105
Received on 2009-11-06 15:23:14 CET

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.