monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Ticker change?


From: Timothy Brownawell
Subject: Re: [Monotone-devel] Ticker change?
Date: Sun, 04 Jun 2006 22:17:50 -0500

On Sun, 2006-06-04 at 09:45 +0200, Richard Levitte - VMS Whacker wrote:
> Hi,
> 
> I just updated my mtn to all the changes in the last week (since
> Monday, to be precise), and noticed that the ticker output has
> changed:
> 
>   : ; mtn pull
>   mtn: ansluter till off.net
>   mtn: letar efter saker att synkronisera:
>   mtn: certifikat | nycklar | revisioner
>   mtn:      18971 |      30 |       6280
>   mtn: byte in |    byte ut | cert in | rev in
>   mtn:     420 |  1.7959 Ki |       0 |      0
>   mtn:    byte in |    byte ut | cert in | rev in
>   mtn: 310.809 Ki | 45.0117 Ki |   24/24 |    6/6
>   mtn: lyckat utbyte med off.net
> 
> There are two things that have changed:
> 
>  - floats aren't limited to one decimal any more.
>  - it seems that locale isn't considered any more.  According to
>    Swedish local, a comma should be used as decimal delimiter, not a
>    period.
> 
> Looking at the code in ui.cc, I don't understand what's happening,
> considering the format strings that should control the way the numbers
> are printed are all N_("%.1f").  Could it be that there's been a
> change in the N_ macro or whatever it uses that affects this?  Could
> it be the format change in sanity.{cc,hh} in revision
> a3dcfaa2a85bb0a6f3a69eb0686f7a76203658a0?

Yes, it is.

// This hides boost::format from infecting every source file.
// Instead, we implement a single very small formatter.
...
  template <typename T> i18n_format & operator%(T const & t)
  {
    get_stream() << t;
    flush();
    return *this;
  }

What this does is feed the argument to a stringstream, and then feed
that stream's string to the boost::format. This ignores any locale
settings on the formatter, and also ignores any special parameters (like
'%.1f') so everything is like '%s' was used.

Why do we need to hide boost::format? Should we just use "extern
template" for our % and make having an instantiation of that be another
requirement for types we want to format, along with having an
operator<< ?

http://colabti.de/irclogger/irclogger_log/monotone?date=2006-06-05,Mon#l166

Tim






reply via email to

[Prev in Thread] Current Thread [Next in Thread]