[Monotone-devel] Ticker change?

2006-06-04 Thread Richard Levitte - VMS Whacker
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?

Cheers,
Richard

-- 
Richard Levitte [EMAIL PROTECTED]
http://richard.levitte.org/

When I became a man I put away childish things, including
 the fear of childishness and the desire to be very grown up.
-- C.S. Lewis


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] Ticker change?

2006-06-04 Thread Richard Levitte - VMS Whacker
OK, I've looked around, and I'm now convinced that the revision I
mentioned is the root cause of the failure of ticker formatting.

Basically, the new formatter implementation in sanity.{cc,hh} seems to
work in a two-step fashion.  First, the data being added to the format
structure used (plain_format or i18n_format) is fed directly to the
internal string stream (pimpl-oss, found by using get_stream()) with
no formatting whatsoever.  THEN, the string built up from the string
stream is fed to the underlying formatting class (pimpl-fmt) in
string form.

The problem with this is that the formatting which is supposed to
happen in the second step has already happened in the first, basically
making the formatting useless for anything other than indicating in
what parts of the format string each piece of data is supposed to end
up.

Graydon, since you did this change, could you tell me how you intended
the design to be?  The lack of comments doesn't really make things
entirely clear.  That or make appropriate changes yourself :-).  (or,
well, if someone could pay me a class in mind reading, I wouldn't mind
that either, there are tons of uses for that :-))

In message [EMAIL PROTECTED] on Sun, 04 Jun 2006 09:45:04 +0200 (CEST), 
Richard Levitte - VMS Whacker [EMAIL PROTECTED] said:

richard Hi,
richard 
richard I just updated my mtn to all the changes in the last week (since
richard Monday, to be precise), and noticed that the ticker output has
richard changed:
richard 
richard   : ; mtn pull
richard   mtn: ansluter till off.net
richard   mtn: letar efter saker att synkronisera:
richard   mtn: certifikat | nycklar | revisioner
richard   mtn:  18971 |  30 |   6280
richard   mtn: byte in |byte ut | cert in | rev in
richard   mtn: 420 |  1.7959 Ki |   0 |  0
richard   mtn:byte in |byte ut | cert in | rev in
richard   mtn: 310.809 Ki | 45.0117 Ki |   24/24 |6/6
richard   mtn: lyckat utbyte med off.net
richard 
richard There are two things that have changed:
richard 
richard  - floats aren't limited to one decimal any more.
richard  - it seems that locale isn't considered any more.  According to
richardSwedish local, a comma should be used as decimal delimiter, not a
richardperiod.
richard 
richard Looking at the code in ui.cc, I don't understand what's happening,
richard considering the format strings that should control the way the numbers
richard are printed are all N_(%.1f).  Could it be that there's been a
richard change in the N_ macro or whatever it uses that affects this?  Could
richard it be the format change in sanity.{cc,hh} in revision
richard a3dcfaa2a85bb0a6f3a69eb0686f7a76203658a0?
richard 
richard Cheers,
richard Richard
richard 
richard -- 
richard Richard Levitte [EMAIL PROTECTED]
richard http://richard.levitte.org/
richard 
richard When I became a man I put away childish things, including
richard  the fear of childishness and the desire to be very grown up.
richard-- C.S. Lewis
richard 
richard 
richard ___
richard Monotone-devel mailing list
richard Monotone-devel@nongnu.org
richard http://lists.nongnu.org/mailman/listinfo/monotone-devel


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] Ticker change?

2006-06-04 Thread Timothy Brownawell
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




___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel


Re: [Monotone-devel] Ticker change?

2006-06-04 Thread Nathaniel Smith
On Sun, Jun 04, 2006 at 10:17:50PM -0500, Timothy Brownawell wrote:
 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 ?

I'd just like to point out that 0.27 is currently blocking on this
bug, plus the win32 test failure, so if the test failure gets fixed we
should also consider simply backing out this change temporarily...

-- Nathaniel

-- 
Eternity is very long, especially towards the end.
  -- Woody Allen


___
Monotone-devel mailing list
Monotone-devel@nongnu.org
http://lists.nongnu.org/mailman/listinfo/monotone-devel