From 40f47448a91666be8e2befe521525f3f507344f9 Mon Sep 17 00:00:00 2001 From: Kazutoshi Satoda Date: Tue, 9 Feb 2016 00:20:31 +0900 Subject: git-svn: enable "svn.pathnameencoding" on dcommit Without the initialization of $self->{pathnameencoding}, conversion in repo_path() is always skipped as $self->{pathnameencoding} is undefined even if "svn.pathnameencoding" is configured. The lack of conversion results in mysterious failure of dcommit (e.g. "Malformed XML") which happen only when a commit involves a change on non-ASCII path. [ew: add test case to t9115, squash LC_ALL=$a_utf8_locale export from Kazutoshi for Cygwin] Signed-off-by: Kazutoshi SATODA Signed-off-by: Eric Wong --- perl/Git/SVN/Editor.pm | 1 + 1 file changed, 1 insertion(+) (limited to 'perl') diff --git a/perl/Git/SVN/Editor.pm b/perl/Git/SVN/Editor.pm index c50176eec9..d9d9bdf331 100644 --- a/perl/Git/SVN/Editor.pm +++ b/perl/Git/SVN/Editor.pm @@ -41,6 +41,7 @@ sub new { "$self->{svn_path}/" : ''; $self->{config} = $opts->{config}; $self->{mergeinfo} = $opts->{mergeinfo}; + $self->{pathnameencoding} = Git::config('svn.pathnameencoding'); return $self; } -- cgit v1.2.3 From 1b42f45255de5844b7fe8d0c60fea74cd5b9f954 Mon Sep 17 00:00:00 2001 From: Kazutoshi Satoda Date: Tue, 9 Feb 2016 00:21:02 +0900 Subject: git-svn: apply "svn.pathnameencoding" before URL encoding The conversion from "svn.pathnameencoding" to UTF-8 should be applied first, and then URL encoding should be applied on the resulting UTF-8 path. The reversed order of these transforms (used before this fix) makes non-UTF-8 URL which causes error from Subversion such as "Filesystem has no item: '...' path not found" when sending a rename (or a copy) from non-ASCII path. [ew: t9115 test case added (requires SVN_HTTPD_PORT set to test), squash LC_ALL=$a_utf8_locale export from Kazutoshi for Cygwin] Signed-off-by: Kazutoshi SATODA Signed-off-by: Eric Wong --- perl/Git/SVN/Editor.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'perl') diff --git a/perl/Git/SVN/Editor.pm b/perl/Git/SVN/Editor.pm index d9d9bdf331..4c4199afec 100644 --- a/perl/Git/SVN/Editor.pm +++ b/perl/Git/SVN/Editor.pm @@ -144,11 +144,12 @@ sub repo_path { sub url_path { my ($self, $path) = @_; + $path = $self->repo_path($path); if ($self->{url} =~ m#^https?://#) { # characters are taken from subversion/libsvn_subr/path.c $path =~ s#([^~a-zA-Z0-9_./!$&'()*+,-])#sprintf("%%%02X",ord($1))#eg; } - $self->{url} . '/' . $self->repo_path($path); + $self->{url} . '/' . $path; } sub rmdirs { -- cgit v1.2.3