1. 01 Feb, 2013 1 commit
  2. 21 Jan, 2013 9 commits
  3. 19 Jan, 2013 1 commit
    • Peter Wu's avatar
      git-svn: do not escape certain characters in paths · cc304627
      Peter Wu authored
      Subversion 1.7 and newer implement HTTPv2, an extension that should make HTTP
      more efficient. Servers with support for this protocol will make the subversion
      client library take an alternative code path that checks (with assertions)
      whether the URL is "canonical" or not.
      
      This patch fixes an issue I encountered while trying to `git svn dcommit` a
      rename action for a file containing a single quote character ("User's Manual"
      to "UserMan.tex"). It does not happen for older subversion 1.6 servers nor
      non-HTTP(S) protocols such as the native svn protocol, only on an Apache server
      shipping SVN 1.7. Trying to `git svn dcommit` under the aforementioned
      conditions yields the following error which aborts the commit process:
      
          Committing to http://example.com/svn ...
          perl: subversion/libsvn_subr/dirent_uri.c:1520: uri_skip_ancestor:
      Assertion `svn_uri_is_canonical(child_uri, ((void *)0))' failed.
          error: git-svn died of signal 6
      
      An analysis of the subversion source for the cause:
      
      - The assertion originates from uri_skip_ancestor which calls
        svn_uri_is_canonical, which fails when the URL contains percent-encoded values
        that do not necessarily have to be encoded (not "canonical" enough). This is
        done by a table lookup in libsvn_subr/path.c. Putting some debugging prints
        revealed that the character ' is indeed encoded to %27 which is not
        considered canonical.
      - url_skip_ancestor is called by svn_ra_neon__get_baseline_info with the root
        repository URL and path as parameters;
      - which is called by copy_resource (libsvn_ra_neon/commit.c) for a copy action
        (or in my case, renaming which is actually copy + delete old);
      - which is called by commit_add_dir;
      - which is assigned as a structure method "add_file" in
        svn_ra_neon__get_commit_editor.
      
      In the whole path, the path argument is not modified.
      
      Through some more uninteresting wrapper functions, the Perl bindings gives you
      access to the add_file method which will pass the path argument without
      modifications to svn.
      
      git-svn calls the "R"(ename) subroutine in Git::SVN::Editor which contains:
      326         my $fbat = $self->add_file($self->repo_path($m->{file_b}), $pbat,
      327                                 $self->url_path($m->{file_a}), $self->{r});
      "repo_path" basically returns the path as-is, unless the "svn.pathnameencoding"
      configuration property is set. "url_path" tries to escape some special
      characters, but does not take all special characters into account, thereby
      causing the path to contain some escaped characters which do not have to be
      escaped.
      
      The list of characters not to be escaped are taken from the
      subversion/libsvn_subr/path.c file to fully account for all characters. Tested
      with a filename containing all characters in the range 0x20 to 0x78 (inclusive).
      Signed-off-by: default avatarPeter Wu <[email protected]>
      Signed-off-by: default avatarEric Wong <[email protected]>
      cc304627
  4. 18 Jan, 2013 10 commits
  5. 17 Jan, 2013 3 commits
    • John Keeping's avatar
      git-svn: teach find-rev to find near matches · 2934a484
      John Keeping authored
      When a single SVN repository is split into multiple Git repositories
      many SVN revisions will exist in only one of the Git repositories
      created.  For some projects the only way to build a working artifact is
      to check out corresponding versions of various repositories, with no
      indication of what those are in the Git world - in the SVN world the
      revision numbers are sufficient.
      
      By adding "--before" to "git-svn find-rev" we can say "tell me what this
      repository looked like when that other repository looked like this":
      
          git svn find-rev --before \
              r$(git --git-dir=/over/there.git svn find-rev HEAD)
      Signed-off-by: John Keeping's avatarJohn Keeping <[email protected]>
      Signed-off-by: default avatarEric Wong <[email protected]>
      2934a484
    • Jonathan Nieder's avatar
      git svn: do not overescape URLs (fallback case) · 9012f571
      Jonathan Nieder authored
      Subversion's canonical URLs are intended to make URL comparison easy
      and therefore have strict rules about what characters are special
      enough to urlencode and what characters should be left alone.
      
      When in the fallback codepath because unable to use libsvn's own
      canonicalization function for some reason, escape special characters
      in URIs according to the svn_uri__char_validity[] table in
      subversion/libsvn_subr/path.c (r935829).  The libsvn versions that
      trigger this code path are not likely to be strict enough to care, but
      it's nicer to be consistent.
      
      Noticed by using SVN 1.6.17 perl bindings, which do not provide
      SVN::_Core::svn_uri_canonicalize (triggering the fallback code),
      with libsvn 1.7.5, whose do_switch is fussy enough to care:
      
        Committing to file:///home/jrn/src/git/t/trash%20directory.\
        t9118-git-svn-funky-branch-names/svnrepo/pr%20ject/branches\
        /more%20fun%20plugin%21 ...
        svn: E235000: In file '[...]/subversion/libsvn_subr/dirent_uri.c' \
        line 2291: assertion failed (svn_uri_is_canonical(url, pool))
        error: git-svn died of signal 6
        not ok - 3 test dcommit to funky branch
      
      After this change, the '!' in 'more%20fun%20plugin!' is not urlencoded
      and t9118 passes again.
      Signed-off-by: default avatarJonathan Nieder <[email protected]>
      Signed-off-by: default avatarEric Wong <[email protected]>
      9012f571
    • Jonathan Nieder's avatar
      Git::SVN::Editor::T: pass $deletions to ->A and ->D · 47263f58
      Jonathan Nieder authored
      This shouldn't make a difference because the $deletions hash is
      only used when adding a directory (see 379862ec, 2012-02-20) but
      it's nice to be consistent to make reading smoother anyway.  No
      functional change intended.
      Signed-off-by: default avatarJonathan Nieder <[email protected]>
      Signed-off-by: default avatarEric Wong <[email protected]>
      47263f58
  6. 15 Jan, 2013 3 commits
  7. 14 Jan, 2013 13 commits