clarification on proper use of ^ in URL

Stefan Sperling stsp at elego.de
Thu Jun 11 15:22:02 CDT 2009


On Thu, Jun 11, 2009 at 04:10:11PM -0400, Robert P. J. Day wrote:
> 
>   in chapter 1, there's a mention of a new 1.6 feature:
> 
>   $ svn list ^/tags/bigsandwich/
> 
> however, if you wanted a list of the very top of the repository, you
> can't just use:
> 
>   $ svn list ^
> 
> you need to use
> 
>   $ svn list ^/
> 
> is that clarified later on?

The magic sequence is "^/", not just "^".

Here's the code (subversion/libsvn_client/cmdline.c):

/* Return true iff ARG is a repository-relative URL: specifically that
 * it starts with the characters "^/".
 * ARG is in UTF-8 encoding.
 * Do not check whether ARG is properly URI-encoded, canonical, or valid
 * in any other way. */
static svn_boolean_t
arg_is_repos_relative_url(const char *arg)
{
  return (0 == strncmp("^/", arg, 2));
}


If the book doesn't explain this, it probably should be made to.

Stefan




More information about the svnbook-dev mailing list