git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git-svn SVN 1.7 fix, take 2

From
Michael G Schwern <schwern@pobox.com>
Date
Jul 25, 2012, 05:36 UTC
Message-ID
<500F85F7.8050304@pobox.com>
In-Reply-To
<20120725045327.GD3055@burratino>
On 2012.7.24 9:53 PM, Jonathan Nieder wrote:
Show 10 quoted lines
> Michael G Schwern wrote:
> 
>> No, now it's just canonicalizing as early as possible.  Preferably within the
>> object accessor rather than at the point of use.  So in the code below,
>> $full_url is already escaped/canonicalized.
> 
> Let's start with this.
> 
> Is svn_path_canonicalize() idempotent?  What does it do when it
> encounters a percent-sign?
Nothing, because paths are not URI escaped. :)

You probably meant svn_uri_canonicalize(). And no, it does not double escape, so its safe to escape as early as possible.

   use SVN::Core;
   my $uri = "http://www.example.com/ foo";
    print SVN::_Core::svn_uri_canonicalize(
        SVN::_Core::svn_uri_canonicalize($uri)
    );
That produces "http://www.example.com/%20foo".

The API docs don't say it specifically, but if it were otherwise it would be impossible to use. You'd have to check first if anything were escaped before canonicalizing. And a user couldn't pass in an escaped URL without risking it being double escaped.

http://subversion.apache.org/docs/api/latest/svn__dirent__uri_8h.html#a8bae33a2fbf86857869f7b0e39a553e7
-- 
'All anyone gets in a mirror is themselves,' she said. 'But what you
gets in a good gumbo is everything.'
    -- "Witches Abroad" by Terry Prachett
Previous: Jonathan NiederNext: Junio C Hamano
Message 12 of 14 in “git-svn SVN 1.7 fix, take 2”
  1. Michael G SchwernJul 24, 2012
  2. Junio C HamanoJul 24, 2012
  3. Michael G SchwernJul 24, 2012
  4. Jonathan NiederJul 24, 2012
  5. Jonathan NiederJul 24, 2012
  6. Michael G SchwernJul 24, 2012
  7. Jonathan NiederJul 24, 2012
  8. Jonathan NiederJul 24, 2012
  9. Junio C HamanoJul 24, 2012
  10. Michael G SchwernJul 25, 2012
  11. Jonathan NiederJul 25, 2012
  12. Michael G SchwernJul 25, 2012
  13. Junio C HamanoJul 25, 2012
  14. Michael G SchwernJul 25, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.