You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by "Peter N. Lundblad" <pe...@famlundblad.se> on 2004/05/17 19:12:48 UTC

[PATCH] Preview of printf -> svn_cmdline_printf etc.

Hi,

I am now starting the work of replacing printf, fprintf and fputs with the
corresponding svn_cmdline_* variants. This patch is only the beginning to
give everybody a chance to see what it will look like with the current
implementation of these three functions. Because we have both a longer
function name and SVN_ERR and we need to not have longer lines than 80
cols (I'm on such a TTY, so I won't break it intentionally:-), the message
strings will be split into many lines sometimes. I don't see a way to
avoid this, though.

Also, I put a comment in about detranslation of property values and
newline markers. I don't understand why we need to convert the string to
native newlines before outputing it through stdio. We use just \n
everywhere and rely on stdio to take care of the rest in this case.

This is all small uninteresting details, still, as you know, it is
important to get this right for I18N. Sorry for cluttering the list with
this incomplete work, but I think it is better to let you seee it now and
have comments than waiting until I have a nearly complete patch.

Regards,
//Peter

Re: [PATCH] Preview of printf -> svn_cmdline_printf etc.

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
Hi,

On Mon, 17 May 2004, Erik Huelsmann wrote:

> The above example would then be wrapped as:
>
> +          SVN_ERR
> +           (svn_cmdline_printf
> +            (pool,
> +             _("property '%s' deleted from repository revision %ld\n"),
> +             pname_utf8, rev));
>
> (bad example though, because the string didn't fit any better on the line,
> but I think you get the idea?)
>
Thanks for the tip. I think I'll use this when it looks too ugly..

//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Preview of printf -> svn_cmdline_printf etc.

Posted by Erik Huelsmann <e....@gmx.net>.
Hi!

> I am now starting the work of replacing printf, fprintf and fputs with the
> corresponding svn_cmdline_* variants. This patch is only the beginning to
> give everybody a chance to see what it will look like with the current
> implementation of these three functions. Because we have both a longer
> function name and SVN_ERR and we need to not have longer lines than 80
> cols (I'm on such a TTY, so I won't break it intentionally:-), the message
> strings will be split into many lines sometimes. I don't see a way to
> avoid this, though.

Some parts of the code move the opening paren to the next line.  When you
use emacs, it then indents the lines near the beginning of the function name
it belongs to.

Index: subversion/clients/cmdline/propdel-cmd.c
===================================================================
--- subversion/clients/cmdline/propdel-cmd.c    (revision 9747)
+++ subversion/clients/cmdline/propdel-cmd.c    (arbetskopia)
@@ -31,6 +31,7 @@
 #include "svn_delta.h"
 #include "svn_error.h"
 #include "svn_utf.h"
+#include "svn_path.h"
 #include "cl.h"
 
 
@@ -92,11 +93,10 @@
                                        &rev, FALSE, ctx, pool));
       if (! opt_state->quiet)
         {
-          const char *pname_stdout;
-          SVN_ERR (svn_cmdline_cstring_from_utf8 (&pname_stdout,
-                                                  pname_utf8, pool));
-          printf (_("property '%s' deleted from repository revision
%ld\n"),
-                  pname_stdout, rev);
+          SVN_ERR (svn_cmdline_printf (pool,
+                                       _("property '%s' deleted from"
+                                         " repository revision %ld\n"),
+                                       pname_utf8, rev));
         }      
     }
   else if (opt_state->start_revision.kind != svn_opt_revision_unspecified)

The above example would then be wrapped as:

+          SVN_ERR
+           (svn_cmdline_printf 
+            (pool, 
+             _("property '%s' deleted from repository revision %ld\n"),
+             pname_utf8, rev));

(bad example though, because the string didn't fit any better on the line,
but I think you get the idea?)

bye,


Erik.

-- 
NEU : GMX Internet.FreeDSL
Ab sofort DSL-Tarif ohne Grundgeb�hr: http://www.gmx.net/dsl


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Preview of printf -> svn_cmdline_printf etc.

Posted by Branko Čibej <br...@xbc.nu>.
Peter N. Lundblad wrote:

>Hi,
>
>On Tue, 18 May 2004, [UTF-8] Branko Ä^Libej wrote:
>
>  
>
>>Peter N. Lundblad wrote:
>>
>>    
>>
>>>Also, I put a comment in about detranslation of property values and
>>>newline markers. I don't understand why we need to convert the string to
>>>native newlines before outputing it through stdio. We use just \n
>>>everywhere and rely on stdio to take care of the rest in this case.
>>>
>>>
>>>      
>>>
>>Because it's not always stdio; sometimes it goes through the stream
>>functions, and those tend to use APR files.
>>
>>    
>>
>I understand that sometimes we need to do exactly this translation. But I
>was asking about this particular case. IMO we shouldn't need any
>translation here?
>  
>
Yes, in this case I think we can rely on stdio to dtrt.




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Preview of printf -> svn_cmdline_printf etc.

Posted by "Peter N. Lundblad" <pe...@famlundblad.se>.
Hi,

On Tue, 18 May 2004, [UTF-8] Branko Ä^Libej wrote:

> Peter N. Lundblad wrote:
>
> >Also, I put a comment in about detranslation of property values and
> >newline markers. I don't understand why we need to convert the string to
> >native newlines before outputing it through stdio. We use just \n
> >everywhere and rely on stdio to take care of the rest in this case.
> >
> >
> Because it's not always stdio; sometimes it goes through the stream
> functions, and those tend to use APR files.
>
I understand that sometimes we need to do exactly this translation. But I
was asking about this particular case. IMO we shouldn't need any
translation here?

Regards,
//Peter

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org


Re: [PATCH] Preview of printf -> svn_cmdline_printf etc.

Posted by Branko Čibej <br...@xbc.nu>.
Peter N. Lundblad wrote:

>Also, I put a comment in about detranslation of property values and
>newline markers. I don't understand why we need to convert the string to
>native newlines before outputing it through stdio. We use just \n
>everywhere and rely on stdio to take care of the rest in this case.
>  
>
Because it's not always stdio; sometimes it goes through the stream 
functions, and those tend to use APR files.




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org