# # # patch "cmd_automate.cc" # from [4c367f3de01bf1174049b589f95a3addde7866ec] # to [a06ad38002be1c8ec9196cdd7eefcb3590429875] # # patch "monotone.texi" # from [f6195a7137a6a3e7ce9d303e1434b306d6462908] # to [9d43489f753d93888dc5033a6d1efb7f1de0cab1] # ============================================================ --- cmd_automate.cc 4c367f3de01bf1174049b589f95a3addde7866ec +++ cmd_automate.cc a06ad38002be1c8ec9196cdd7eefcb3590429875 @@ -63,7 +63,7 @@ namespace commands { } } -static string const interface_version = "7.0"; +static string const interface_version = "8.0"; // Major or minor number only increments once for each monotone release; // check the most recent release before incrementing this. ============================================================ --- monotone.texi f6195a7137a6a3e7ce9d303e1434b306d6462908 +++ monotone.texi 9d43489f753d93888dc5033a6d1efb7f1de0cab1 @@ -7221,6 +7221,8 @@ @section Automation @itemize @item +8.0 -- Introduced out of band streams ('e', 'p', 't', 'w') and changed error reporting address@hidden 3.1 -- Added the 'o' item to the recognized input. This change should not break anything. @item @@ -7266,6 +7268,16 @@ @section Automation 23501f8afd1f9ee037019765309b0f8428567f8a 2c295fcf5fe20301557b9b3a5b4d437b5ab8ec8c 1:0:l:41:7706a422ccad41621c958affa999b1a1dd644e79 +2:2:e:38:misuse: key 'address@hidden' already exists +2:2:l:0: +3:0:p:32:generating key-pair 'address@hidden' +3:0:p:45:storing key-pair 'address@hidden' in /tmp/y/keys/ +3:0:p:44:storing public key 'address@hidden' in /tmp/x.db +3:0:l:217: name "address@hidden" + public_hash [b76ede07274906866de25bbf6e2919cb8583868b] + private_hash [dd2a7505cb1a001f625b90bd7e300dfd7de6adb2] + public_location "database" "keystore" +private_location "keystore" @end verbatim @item Output format: @@ -7273,32 +7285,74 @@ @section Automation The output consists of one or more packets for each command. A packet looks like: -:::: +:::: is a decimal number specifying which command this output is from. It is 0 for the first command, and increases by one each time. is 0 for success, 1 for a syntax error, and 2 for any other error. - is 'l' if this is the last piece of output for this command, and 'm' -if there is more output to come. + is an identifier for which output stream this packet represents, +allowing multiple streams to be multiplexed over the channel. The following +streams are presently defined; more streams may be added later. + '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 special 'l' value is described below. + + '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'''. + + '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'''. + + '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'''. + +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. + + 'p': informative progress messages from the command during execution. + + 't': ticker updates, as may be used by the gui to update a progress bar + + is the number of bytes in the output. is a piece of the output of the command. -All but the last packet for a given command will have the - field set to 'm'. +The last packet for a given command will have the field set to 'l'. +This packet indicates termination of all streams for the command. Any +content in this packet is considered to be part of the 'm' stream. The + in this packet is likely to be zero if there has been an error +message that has prevented or interrupted normal output. +If a client implementation gets a record for a stream type it does +not recognise, the record should be ignored. + @item Error conditions: If a badly formatted or invalid command is received, or a command is given with invalid arguments or options, prints an error message to standard error and exits with nonzero status. Errors in the commands run through this interface do not affect the exit status. Instead, the -field in the output is set to 2, and the output of the command becomes -whatever error message would have been given. +field in the output is set to 2, the error message is reported on the 'e' stream +and terminated by an (empty) 'l' message. address@hidden Multiple streams + +The multiple stream encoding allows the output of errors and warnings to be +associated with the command that generated them, allows the communication +path to always stay in sync, and offers the opportunity to add other stream +types for other useful purposes in the future as needs arise. + @end table @item mtn automate get_revision @var{id}