# # patch "format.cc" # from [89c8a712b18ef4b392a00244087be07a2678c7a6] # to [84e3fc07c09bd99df48e9c8da948b20fe4715a96] # # patch "format.hh" # from [e2060fde3c8635c17e1c3d0cb164cebd6bfba6b2] # to [c5d8038ca6a05a784badf2fba25f08ec0975b787] # # patch "monotone.1" # from [b4333b9f17ba604ca732d3de2e833c78bf0991a7] # to [2f053fc3c1b544dc2cfd523d443a4968966b721c] # # patch "monotone.texi" # from [4ec8f99151eb98cd9058d5afaa31dd94fd4c2166] # to [1cd3647b4cc2c03fc45c6abfe8072a6ada288f8e] # --- format.cc +++ format.cc @@ -102,6 +102,9 @@ // final string buf.assign(start_current_fmt, i); fmtstrs[current_fmt] = utf8(buf); + + // assign the starting point for apply() + startpoint = fmtstrs[FMTIDX_REVISION]().begin (); } @@ -349,7 +352,7 @@ app.db.get_revision_certs (rid, certs); erase_bogus_certs (certs, app); - std::string::const_iterator i = fmtstrs[FMTIDX_REVISION]().begin (); + std::string::const_iterator i = startpoint; std::string::const_iterator e = fmtstrs[FMTIDX_REVISION]().end(); while (i != e) { @@ -405,6 +408,11 @@ else out << rid.inner()(); break; + case '+': + N(!short_form, F("no short form for the '%%+' formatting specifier")); + startpoint = ++i; // predispone next starting point + N(startpoint != e, F("A format string can't terminate with '%%+'")); + return; // exit directly from the function, skipping the rest default: N(!short_form, F("no short form for changelog specifier")); // unrecognized specifier, perhaps is a changeset one ? @@ -418,6 +426,9 @@ ++i; } + + // resets fmt str starting point + startpoint = fmtstrs[FMTIDX_REVISION]().begin (); } --- format.hh +++ format.hh @@ -80,6 +80,7 @@ private: std::ostream & out; utf8 fmtstrs[8]; + std::string::const_iterator startpoint; }; --- monotone.1 +++ monotone.1 @@ -328,7 +328,11 @@ %m : manifest id .br %sm : shortened manifest id +.br +%+ : terminates formatting for the current revision. The next revision +will be formatted by the specifiers following %+ + The short forms have the following meanings: For author, everything before the first @ symbol. For branch, everything after the last '.' character. For date, everything before the first 'T' character. @@ -360,6 +364,15 @@ \\\\, \\% and \\@ are used to obtain the \\, % and @ char respectively. The default format string is '%i\\n'. + +The specifier %+ is used to apply alternating format strings to +different revisions. When found, a %+ specifiers terminates the +formatting of current revision. +The next revision to be formatted will 'see' only the format string +following the %s. +To have a two column author output you will use a '%a %+ %a\\n' format +string. + .TP \fB--xml\fP Generate an xml document based on automate output and containing full --- monotone.texi +++ monotone.texi @@ -4875,6 +4875,8 @@ %r : value of testresult certificate %t : value of tag certificate %[s]m : manifest id +%+ : terminates formatting for the current revision. The next revision +will be formatted by the specifiers following %+ @end verbatim Changeset Placeholders: @@ -4904,6 +4906,36 @@ The default format string is '%i\\n'. +The specifier %+ is used to apply alternating format strings to +different revisions. When found, a %+ specifiers terminates the +formatting of current revision. +The next revision to be formatted will 'see' only the format string +following the %s. +To have a two column author output you will use a '%a %+ %a\n' format +string. +Note: without the %+, the formatting specifiers could still be given +multiple times, but their output will refer to the same revision. +Consider as an example two commits, one by jim@@juicebot.co.jp and one +by beth@@juicebot.co.jp. + +The format string '%a %a\n' will give you + address@hidden address@hidden +jim@@juicebot.co.jp jim@@juicebot.co.jp +beth@@juicebot.co.jp beth@@juicebot.co.jp address@hidden group address@hidden smallexample + +where '%a %+ %a\n' gives instead + address@hidden address@hidden +jim@@juicebot.co.jp beth@@juicebot.co.jp address@hidden group address@hidden smallexample + + @page @node RCS @section RCS @@ -6577,8 +6609,8 @@ data. Special changeset placeholders put in the common expression are substituted by the formatted changeset informations. -The separate the common formatting expression is separated from the -changeset ones by apposite markers. +The common formatting expression is separated from the changeset ones +by apposite markers. Common formatting specifiers: @verbatim @@ -6596,6 +6628,8 @@ %t : value of tag certificate %m : manifest id %sm : shortened manifest id +%+ : terminates formatting for the current revision. The next revision +will be formatted by the specifiers following %+ @end verbatim The short forms have the following meanings: for ids, the first 8