# # # patch "monotone.texi" # from [9d43489f753d93888dc5033a6d1efb7f1de0cab1] # to [012e0b12d0b08056e9513d06bfb108bbb147242e] # # patch "ui.cc" # from [fb353e177a61d03aef4820424c0541cdb998bb7d] # to [57359612fa7d6dc7ec77093df261ce76fa08d3aa] # ============================================================ --- monotone.texi 9d43489f753d93888dc5033a6d1efb7f1de0cab1 +++ monotone.texi 012e0b12d0b08056e9513d06bfb108bbb147242e @@ -7278,6 +7278,11 @@ @section Automation private_hash [dd2a7505cb1a001f625b90bd7e300dfd7de6adb2] public_location "database" "keystore" private_location "keystore" +0:0:t:34:c:certificates;k:keys;r:revisions; +0:0:t:12:c=0;k=0;r=0; +0:0:t:13:c#0;k#0;r#64; +0:0:t:14:c#0;k#0;r#128; +0:0:t:6:c;k;r; @end verbatim @item Output format: @@ -7296,34 +7301,87 @@ @section Automation allowing multiple streams to be multiplexed over the channel. The following streams are presently defined; more streams may be added later. address@hidden address@hidden 'm' and 'l': the 'm' stream represents the normal stdout automate output of - the command, formatted as described in the description for that command. + the command, formatted as described in the description for that command. + The special 'l' value is described below. address@hidden + 'e': the 'e' stream represents any (unstructured) error message data. - 'e': the 'e' stream represents any (unstructured) error message data. Internally, this maps to calls to the E() and N() print macros that would normally be written by the command to the program's stderr stream, if the automate sub-command had been called directly rather than via '''stdio'''. address@hidden + 'w': the 'w' stream represents any (unstructured) warning message data. - 'w': the 'w' stream represents any (unstructured) warning message data. Internally, this maps to calls to the W() print macro that would normally be written by the command to the program's stderr stream, if the automate sub-command had been called directly rather than via '''stdio'''. - address@hidden 'p': the 'p' stream represents any (unstructured) progress message data. + Internally, this maps to calls to the P() print macro that would normally be written by the command to the program's stderr stream, if the automate sub-command had been called directly rather than via '''stdio'''. address@hidden + 't': the 't' stream represents ticker updates, which may be used + by a (G)UI to update a progress bar. -As needed, some of these (e,w,p) messages may be replaced with structured -and well-defined error information for more direct interpretation by a gui -frontend, not localised, on a different stream. + The output for this channel can be described as follows: - 'p': informative progress messages from the command during execution. + @itemize + @item + ::= + @item + ::= ':' + @item + ::= + + @item + ::= + @item + ::= '=' + @item + ::= '#' + @item + ::= "\w+" + @item + ::= "[^;]+" + @item + ::= ['0'-'9']+ + @item + ::= ';' + @end itemize - 't': ticker updates, as may be used by the gui to update a progress bar + The definition tells the implementor the short name and long name of any + upcoming ticker event. The names and meanings are command-specific and + therefor explained for the particular commands which support ticker output. + The total_count might be 0 right at the start and can later be changed to a + different number if the command later on knows a more exact value. If this is + the case, this stanza is outputted again with this new value. A constant + total_count of 0 means that the command may continue to run for a undefined + amount of time until the end stanza appears. + The advance tells the implementor how much work has been done so far. + + Finally, the end stanza is printed just before the ticker ends + (i.e. the work has been done). + + All counts output absolute, raw values; no modulation takes place. Its + usually the case that definition, total_count, advance and end are printed + into separate stanzas. Its also possible that two or more parallel tickers + put out their stanzas at the same time, in this case its ensured that the + output does not get intermixed i.e. at first all definitions are outputted, + afterwards all total_counts, aso. + address@hidden itemize + +As needed, some of these (e,w,p) messages may be replaced with structured +and well-defined error information for more direct interpretation by a gui +frontend, not localised, on a different stream. + is the number of bytes in the output. is a piece of the output of the command. ============================================================ --- ui.cc fb353e177a61d03aef4820424c0541cdb998bb7d +++ ui.cc 57359612fa7d6dc7ec77093df261ce76fa08d3aa @@ -446,39 +446,56 @@ void tick_write_stdio::write_ticks() void tick_write_stdio::write_ticks() { I(ui.imp); - string description, tickline; + string headers, sizes, tickline; for (map::const_iterator i = ui.imp->tickers.begin(); i != ui.imp->tickers.end(); ++i) { std::map::iterator it = last_ticks.find(i->second->shortname); + // we output each explanation stanza just once and every time the // total count has been changed - if (it == last_ticks.end() || it->second != i->second->total) + if (it == last_ticks.end()) { - description += i->second->shortname + ":" - + i->second->name + ":" - + lexical_cast(i->second->total) + ";"; - - last_ticks.erase(i->second->shortname); - last_ticks[i->second->shortname] = i->second->total; + headers += i->second->shortname + ":" + i->second->name + ";"; + sizes += i->second->shortname + "=" + lexical_cast(i->second->total) + ";"; + last_ticks[i->second->shortname] = i->second->total; } + else + if (it->second != i->second->total) + { + sizes += i->second->shortname + "=" + lexical_cast(i->second->total) + ";"; + last_ticks[i->second->shortname] = i->second->total; + } - tickline += i->second->shortname + ":" + lexical_cast(i->second->ticks); - tickline += ";"; + tickline += i->second->shortname + "#" + lexical_cast(i->second->ticks) + ";"; } - if (!description.empty()) + if (!headers.empty()) { - global_sanity.maybe_write_to_out_of_band_handler('T', description); + global_sanity.maybe_write_to_out_of_band_handler('t', headers); } + if (!sizes.empty()) + { + global_sanity.maybe_write_to_out_of_band_handler('t', sizes); + } + + I(!tickline.empty()); global_sanity.maybe_write_to_out_of_band_handler('t', tickline); } void tick_write_stdio::clear_line() { - global_sanity.maybe_write_to_out_of_band_handler('T', ""); + std::map::iterator it; + std::string out; + + for (it = last_ticks.begin(); it != last_ticks.end(); it++) + { + out += it->first + ";"; + } + + global_sanity.maybe_write_to_out_of_band_handler('t', out); last_ticks.clear(); }