All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: Kazutoshi Satoda <k_satoda@f2.dion.ne.jp>
Cc: git@vger.kernel.org, alex.crezoff@gmail.com
Subject: Re: [PATCH 2/2] git-svn: apply "svn.pathnameencoding" before URL encoding
Date: Mon, 15 Feb 2016 00:33:31 +0000	[thread overview]
Message-ID: <20160215003331.GA19436@dcvr.yhbt.net> (raw)
In-Reply-To: <56B8B25E.9000001@f2.dion.ne.jp>

Kazutoshi Satoda <k_satoda@f2.dion.ne.jp> wrote:
> 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.
> 
> Signed-off-by: Kazutoshi SATODA <k_satoda@f2.dion.ne.jp>

Thanks, running full SVN tests now.

Signed-off-by: Eric Wong <normalperson@yhbt.net>

> --- 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;
>  }

This is trickier to test, as it requires an https?:// URL.
It always succeeds with the default file:// URL.

diff --git a/t/t9115-git-svn-dcommit-funky-renames.sh b/t/t9115-git-svn-dcommit-funky-renames.sh
index 82222fd..9828f05 100755
--- a/t/t9115-git-svn-dcommit-funky-renames.sh
+++ b/t/t9115-git-svn-dcommit-funky-renames.sh
@@ -93,6 +93,18 @@ test_expect_success 'svn.pathnameencoding=cp932 new file on dcommit' '
 	git svn dcommit
 '
 
+test_expect_success 'svn.pathnameencoding=cp932 rename on dcommit' '
+	inf=$(printf "\201\207") &&
+	git config svn.pathnameencoding cp932 &&
+	echo inf >"$inf" &&
+	git add "$inf" &&
+	git commit -m "inf" &&
+	git svn dcommit &&
+	git mv "$inf" inf &&
+	git commit -m "inf rename" &&
+	git svn dcommit
+'
+
 stop_httpd
 
 test_done
-- 
EW

  reply	other threads:[~2016-02-15  0:33 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-08 15:19 [PATCH 0/2] enable "svn.pathnameencoding" on dcommit Kazutoshi Satoda
2016-02-08 15:20 ` [PATCH 1/2] git-svn: " Kazutoshi Satoda
2016-02-15  0:30   ` Eric Wong
2016-02-08 15:21 ` [PATCH 2/2] git-svn: apply "svn.pathnameencoding" before URL encoding Kazutoshi Satoda
2016-02-15  0:33   ` Eric Wong [this message]
2016-02-08 22:58 ` [PATCH 0/2] enable "svn.pathnameencoding" on dcommit Eric Wong
2016-02-15  0:52   ` [PULL] svn pathnameencoding for git svn dcommit Eric Wong
2016-02-15 21:32     ` Junio C Hamano
2016-02-16  3:29     ` Kazutoshi Satoda
2016-02-16  6:33       ` Eric Wong
2016-02-16 16:19         ` Kazutoshi Satoda
2016-02-20 23:37           ` Eric Wong
2016-02-21 13:12             ` Kazutoshi Satoda
2016-02-27 18:28   ` [PATCH 1/1] t9115: Skip pathnameencoding=cp932 under HFS tboegi
2016-02-28  4:59     ` Eric Wong
2016-02-28 17:52       ` Torsten Bögershausen
2016-03-15  1:59         ` Eric Wong
2016-03-15  5:23           ` Torsten Bögershausen
2016-03-15  7:09             ` Eric Wong
2016-03-16 17:37               ` Kazutoshi Satoda
2016-03-17  5:16                 ` Torsten Bögershausen
2016-03-17  5:35                   ` Torsten Bögershausen
2016-03-18  2:15                     ` Kazutoshi Satoda
2016-03-19  6:59                       ` Torsten Bögershausen
2016-03-18  2:14                   ` Kazutoshi Satoda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160215003331.GA19436@dcvr.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=alex.crezoff@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=k_satoda@f2.dion.ne.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.