You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Bluce Lu <bl...@51buy.com> on 2013/04/25 08:30:22 UTC

svn command --cl don't support names that contain chinese characters.

svn command --cl don't support names that contain chinese characters.

 

E,g. command “svn status -q D:\Project”, we see there is a changelist
named “好”, but when use command “svn status -q --verbose D:\Project
--ignore-externals --cl 好”, there is nothing to print.

 



 




答复: svn command --cl don't support names that contain chinese characters.

Posted by Bluce Lu <bl...@51buy.com>.
I used tortoise svn to create changelist "好". :)

-----邮件原件-----
发件人: C. Michael Pilato [mailto:cmpilato@collab.net] 
发送时间: 2013年4月25日 20:18
收件人: Philip Martin
抄送: Bluce Lu; users@subversion.apache.org
主题: Re: svn command --cl don't support names that contain chinese characters.

On 04/25/2013 05:14 AM, Philip Martin wrote:
> "Bluce Lu" <bl...@51buy.com> writes:
> 
>> svn command --cl don't support names that contain chinese characters.
>>
>> E,g. command “svn status -q D:\Project”, we see there is a changelist 
>> named “好”, but when use command “svn status -q --verbose D:\Project 
>> --ignore-externals --cl 好”, there is nothing to print.
> 
> Does "svn st --cl 好" without the other options work?  Are you using a
> UTF-8 environment or some other encoding?
> 
> Chinese changelist names should work.  This works on my Linux box:
> 
> $ svnadmin create repo
> $ svn -mm import repo/format file://`pwd`/repo/f $ svn co 
> file://`pwd`/repo wc $ svn cl 好 wc/f $ svn st --cl 好 wc -v -q 
> --ignore-externals
> 
> --- Changelist '好':
>                  1        1 pm           wc/f
> 
> Does that simple example work for you?

Code inspection tells me that when we set changelists (with 'svn
changelist') we convert the changelist name provided on the command-line to
UTF-8 (svn/changelist-cmd.c:58).  But when we're stashing in the options baton the value of the --changelist option, there's no such translation (svn/svn.c:2162).

Your Linux box is probably using a UTF8 locale, Philip.  Perhaps the OP's Windows box is using something else (GB18030 or somesuch)?

Is this all that's needed?

Index: subversion/svn/svn.c
===================================================================
--- subversion/svn/svn.c	(revision 1471390)
+++ subversion/svn/svn.c	(working copy)
@@ -2159,7 +2159,8 @@
         opt_state.remove = TRUE;
         break;
       case opt_changelist:
-        opt_state.changelist = apr_pstrdup(pool, opt_arg);
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+        opt_state.changelist = utf8_opt_arg;
         if (opt_state.changelist[0] == '\0')
           {
             err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,



--
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Enterprise Cloud Development



Re: svn command --cl don't support names that contain chinese characters.

Posted by Daniel Shahaf <da...@apache.org>.
Philip Martin wrote on Thu, Apr 25, 2013 at 15:19:45 +0100:
> Daniel Shahaf <da...@apache.org> writes:
> 
> > On Thu, Apr 25, 2013 at 08:37:01AM -0400, C. Michael Pilato wrote:
> >> Committed my patch:
> >
> > ... which means the fix will likely be released in 1.7.10 and 1.8.0-alpha1 (or
> > 1.8.0-rc1).  The fix does not affect tortoisesvn; if it exhibits a problem,
> > contact the tortoisesvn developers at http://tortoisesvn.net/support.html.
> 
> The workaround is to switch to a UTF-8 environment. If that is not
> possible you need to find some way of entering the UTF-8 representation
> of the changelist at the command line.  In an ISO-8859-1 environment on
> Linux I can use the 好 changelist by doing:
> 
> $ svn st --cl `printf "\345\245\275"` wc
> 
> --- Changelist '?\229?\165?\189':
>         wc/f

IOW, the workaround is to enter a $LOCAL_ENCODING string whose
representation in bytes is the UTF-8 of the string you want.  I haven't
tested that, but you might be able to compute such a string via
'svn status | sed -ne 's/.*Changelist//p' | iconv -f utf-8 -t $LOCAL_ENCODING'.

Re: svn command --cl don't support names that contain chinese characters.

Posted by Philip Martin <ph...@wandisco.com>.
Daniel Shahaf <da...@apache.org> writes:

> On Thu, Apr 25, 2013 at 08:37:01AM -0400, C. Michael Pilato wrote:
>> Committed my patch:
>
> ... which means the fix will likely be released in 1.7.10 and 1.8.0-alpha1 (or
> 1.8.0-rc1).  The fix does not affect tortoisesvn; if it exhibits a problem,
> contact the tortoisesvn developers at http://tortoisesvn.net/support.html.

The workaround is to switch to a UTF-8 environment. If that is not
possible you need to find some way of entering the UTF-8 representation
of the changelist at the command line.  In an ISO-8859-1 environment on
Linux I can use the 好 changelist by doing:

$ svn st --cl `printf "\345\245\275"` wc

--- Changelist '?\229?\165?\189':
        wc/f

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download

Re: svn command --cl don't support names that contain chinese characters.

Posted by Daniel Shahaf <da...@apache.org>.
On Thu, Apr 25, 2013 at 08:37:01AM -0400, C. Michael Pilato wrote:
> Committed my patch:

... which means the fix will likely be released in 1.7.10 and 1.8.0-alpha1 (or
1.8.0-rc1).  The fix does not affect tortoisesvn; if it exhibits a problem,
contact the tortoisesvn developers at http://tortoisesvn.net/support.html.

Re: svn command --cl don't support names that contain chinese characters.

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 04/25/2013 08:31 AM, Philip Martin wrote:
> Yes, I was using UTF-8.  I see the bug in iso-8859-1:
> 
> $ svn cl å wc/f
> A [å] wc/f
> $ svn st wc
> 
> --- Changelist 'å':
>         wc/f
> $ svn st --cl å wc
> $
> 
> With your patch:
> 
> $ svn st --cl å wc
> 
> --- Changelist 'å':
>         wc/f

Committed my patch:
   Sending        subversion/svn/svn.c
   Transmitting file data .
   Committed revision 1475724.

-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Enterprise Cloud Development


Re: svn command --cl don't support names that contain chinese characters.

Posted by Philip Martin <ph...@wandisco.com>.
"C. Michael Pilato" <cm...@collab.net> writes:

> Your Linux box is probably using a UTF8 locale, Philip.  Perhaps the OP's
> Windows box is using something else (GB18030 or somesuch)?
>
> Is this all that's needed?
>
> Index: subversion/svn/svn.c
> ===================================================================
> --- subversion/svn/svn.c	(revision 1471390)
> +++ subversion/svn/svn.c	(working copy)
> @@ -2159,7 +2159,8 @@
>          opt_state.remove = TRUE;
>          break;
>        case opt_changelist:
> -        opt_state.changelist = apr_pstrdup(pool, opt_arg);
> +        SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
> +        opt_state.changelist = utf8_opt_arg;
>          if (opt_state.changelist[0] == '\0')
>            {
>              err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,

Yes, I was using UTF-8.  I see the bug in iso-8859-1:

$ svn cl å wc/f
A [å] wc/f
$ svn st wc

--- Changelist 'å':
        wc/f
$ svn st --cl å wc
$

With your patch:

$ svn st --cl å wc

--- Changelist 'å':
        wc/f

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download

Re: svn command --cl don't support names that contain chinese characters.

Posted by "C. Michael Pilato" <cm...@collab.net>.
On 04/25/2013 05:14 AM, Philip Martin wrote:
> "Bluce Lu" <bl...@51buy.com> writes:
> 
>> svn command --cl don't support names that contain chinese characters.
>>
>> E,g. command “svn status -q D:\Project”, we see there is a changelist
>> named “好”, but when use command “svn status -q --verbose D:\Project
>> --ignore-externals --cl 好”, there is nothing to print.
> 
> Does "svn st --cl 好" without the other options work?  Are you using a
> UTF-8 environment or some other encoding?
> 
> Chinese changelist names should work.  This works on my Linux box:
> 
> $ svnadmin create repo
> $ svn -mm import repo/format file://`pwd`/repo/f
> $ svn co file://`pwd`/repo wc
> $ svn cl 好 wc/f
> $ svn st --cl 好 wc -v -q --ignore-externals
> 
> --- Changelist '好':
>                  1        1 pm           wc/f
> 
> Does that simple example work for you?

Code inspection tells me that when we set changelists (with 'svn
changelist') we convert the changelist name provided on the command-line to
UTF-8 (svn/changelist-cmd.c:58).  But when we're stashing in the options
baton the value of the --changelist option, there's no such translation
(svn/svn.c:2162).

Your Linux box is probably using a UTF8 locale, Philip.  Perhaps the OP's
Windows box is using something else (GB18030 or somesuch)?

Is this all that's needed?

Index: subversion/svn/svn.c
===================================================================
--- subversion/svn/svn.c	(revision 1471390)
+++ subversion/svn/svn.c	(working copy)
@@ -2159,7 +2159,8 @@
         opt_state.remove = TRUE;
         break;
       case opt_changelist:
-        opt_state.changelist = apr_pstrdup(pool, opt_arg);
+        SVN_INT_ERR(svn_utf_cstring_to_utf8(&utf8_opt_arg, opt_arg, pool));
+        opt_state.changelist = utf8_opt_arg;
         if (opt_state.changelist[0] == '\0')
           {
             err = svn_error_create(SVN_ERR_CL_ARG_PARSING_ERROR, NULL,



-- 
C. Michael Pilato <cm...@collab.net>
CollabNet   <>   www.collab.net   <>   Enterprise Cloud Development


Re: svn command --cl don't support names that contain chinese characters.

Posted by Philip Martin <ph...@wandisco.com>.
"Bluce Lu" <bl...@51buy.com> writes:

> svn command --cl don't support names that contain chinese characters.
>
> E,g. command “svn status -q D:\Project”, we see there is a changelist
> named “好”, but when use command “svn status -q --verbose D:\Project
> --ignore-externals --cl 好”, there is nothing to print.

Does "svn st --cl 好" without the other options work?  Are you using a
UTF-8 environment or some other encoding?

Chinese changelist names should work.  This works on my Linux box:

$ svnadmin create repo
$ svn -mm import repo/format file://`pwd`/repo/f
$ svn co file://`pwd`/repo wc
$ svn cl 好 wc/f
$ svn st --cl 好 wc -v -q --ignore-externals

--- Changelist '好':
                 1        1 pm           wc/f

Does that simple example work for you?

-- 
Certified & Supported Apache Subversion Downloads:
http://www.wandisco.com/subversion/download