# # patch "format.cc" # from [29a6364ec707c46d72ec6c8c2ec6ad83a0bc5972] # to [7f4d767f35714c10227cf8d5bd3fba12d8992603] # # patch "monotone.1" # from [56aebdc5617d60b0957860b309168447cd35c5fd] # to [4eb5c3071fccd6049a1b32b58ba63519b560ca25] # # patch "monotone.texi" # from [db6e79ef90f20e447aff4024f13e8f481504542f] # to [cd8a31e921d9fadf13b66aa2ea207b998d7d9dac] # --- format.cc +++ format.cc @@ -380,48 +380,56 @@ ++i; if (i == e) return; + + bool short_form = false; + if (*i == 's') { + short_form = true; + ++i; + } + if (i == e) + return; + switch (*i) { case 'd': - print_cert (certs, date_cert_name); + print_cert (certs, date_cert_name, short_form, false, "T"); break; - //case 'D': - //print_cert (certs, date_cert_name, true, false, "T"); - //break; case 'a': - print_cert (certs, author_cert_name); + print_cert (certs, author_cert_name, short_form, false, "@"); break; - //case 'A': - //print_cert (certs, author_cert_name, true, false, "@"); - //break; case 't': + N(!short_form, F("no short form for tag specifier")); print_cert (certs, tag_cert_name); break; case 'l': + N(!short_form, F("no short form for changelog specifier")); print_cert (certs, changelog_cert_name); break; case 'e': + N(!short_form, F("no short form for comment specifier")); print_cert (certs, comment_cert_name); break; case 's': + N(!short_form, F("no short form for testresult specifier")); print_cert (certs, testresult_cert_name); break; case 'b': - print_cert (certs, branch_cert_name); + print_cert (certs, branch_cert_name, false, short_form, "."); break; - //case 'B': - //print_cert (certs, branch_cert_name, false, true, "."); - //break; case 'm': - out << rev.new_manifest.inner()(); + if (short_form) + out << rev.new_manifest.inner()().substr(0, 8); + else + out << rev.new_manifest.inner()(); break; case 'i': - out << rid.inner()(); + if (short_form) + out << rid.inner()().substr(0, 8); + else + out << rid.inner()(); break; - //case 'I': - //out << rid.inner()().substr(0, 8); - //break; default: + N(!short_form, F("no short form for changelog specifier")); // unrecognized specifier, perhaps is a changeset one ? handle_cset(i, rev); } --- monotone.1 +++ monotone.1 @@ -291,7 +291,7 @@ An alias for \fB--xargs=\fI\fP .TP \fB--format \fI\fP -Applies the specified format string at automate output. +Applies the specified format string at automate or annotate output. The format string is made by a common part, applied to each revision, and one or more optional changeset subformats, applied to changeset data. @@ -301,24 +301,39 @@ Common formatting specifiers: -%a : value of author certificate +%a : value of author certificate .br -%b : value of branch certificate +%sa : shortened value of author certificate .br -%d : value of date certificate +%b : value of branch certificate .br -%e : value of comment certificate +%sb : shortened value of branch certificate .br -%i : revision id +%d : value of date certificate .br -%l : value of changelog certificate +%sd : shortened value of date certificate .br -%s : value of testresult certificate +%e : value of comment certificate .br -%t : value of tag certificate +%i : revision id .br -%m : manifest id +%si : shortened revision id +.br +%l : value of changelog certificate +.br +%s : value of testresult certificate +.br +%t : value of tag certificate +.br +%m : manifest id +.br +%sm : shortened manifest id +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. +For ids, the first 8 characters. + Changeset Placeholders: %P : ancestors (marker @P) --- monotone.texi +++ monotone.texi @@ -6563,7 +6563,7 @@ An alias for @address@hidden}. @item @address@hidden} -Applies the specified format string at automate output. +Applies the specified format string at automate or annotate output. The format string is made by a common part, applied to each revision, and one or more optional changeset subformats, applied to changeset data. @@ -6574,17 +6574,27 @@ Common formatting specifiers: @verbatim -%a : value of author certificate -%b : value of branch certificate -%d : value of date certificate -%e : value of comment certificate -%i : revision id -%l : value of changelog certificate -%s : value of testresult certificate -%t : value of tag certificate -%m : manifest id +%a : value of author certificate +%sa : shortened value of author certificate +%b : value of branch certificate +%sb : shortened value of branch certificate +%d : value of date certificate +%sd : shortened value of date certificate +%e : value of comment certificate +%i : revision id +%si : shortened revision id +%l : value of changelog certificate +%s : value of testresult certificate +%t : value of tag certificate +%m : manifest id +%sm : shortened manifest id @end verbatim +The short forms have the following meanings: for ids, the first 8 +characters. For author, everything before the first @ symbol. For +branch, everything after the last '.' character. For date, everything +before the first 'T' character. + Changeset Placeholders: @verbatim %P : ancestors (marker @P)