# # patch "annotate.cc" # from [c008c4473c682ce6914519ca99d4ae660963be7f] # to [817609bc9b4ebe8e283df71697bbd67be7973b1d] # # patch "app_state.cc" # from [8661a46d1ea69e5caab3fe6bd61c240e5b6b63f5] # to [6854a00b71d951e418e6af1920b803b7ea92e8a2] # # patch "app_state.hh" # from [002d9392a42c97aefa17f17002bc72503f1a5f99] # to [fce7c3483c411582da6840b843c642b45892d52e] # # patch "monotone.cc" # from [fe2895619e3ff270e3c5e308066b8ae3263c8e04] # to [2bd19f9581fe82dd15b89acb6b3a25826ed6b439] # --- annotate.cc +++ annotate.cc @@ -213,7 +213,8 @@ std::set::const_iterator endrev) { std::ostringstream res_stream; - PrintFormatter pf(res_stream, app, app.format_string); + utf8 fs = (app.default_format) ? utf8("%i: ") : app.format_string; + PrintFormatter pf(res_stream, app, fs); size_t max_annotate_len = 0; std::set::const_iterator i; --- app_state.cc +++ app_state.cc @@ -32,7 +32,7 @@ app_state::app_state() : branch_name(""), db(""), stdhooks(true), rcfiles(true), search_root("/"), depth(-1), - format_string("%i\\n"), xml_enabled(false) + format_string("%i\\n"), default_format(true), xml_enabled(false) { db.set_app(this); } @@ -295,14 +295,20 @@ } void -app_state::set_fmtstring(utf8 const & f) +app_state::set_format_string(utf8 const & f) { format_string = f; } void -app_state::set_xml() +app_state::set_default_format(bool val) { + default_format = val; +} + +void +app_state::set_xml_enabled() +{ xml_enabled = true; } --- app_state.hh +++ app_state.hh @@ -44,6 +44,7 @@ long depth; fs::path pidfile; utf8 format_string; + bool default_format; bool xml_enabled; void allow_working_copy(); @@ -77,8 +78,9 @@ void set_rcfiles(bool b); void add_rcfile(utf8 const & filename); - void set_fmtstring(utf8 const & fmtstring); - void set_xml(); + void set_format_string(utf8 const & fmtstring); + void set_default_format(bool val); + void set_xml_enabled(); explicit app_state(); ~app_state(); --- monotone.cc +++ monotone.cc @@ -262,6 +262,7 @@ try { app_state app; + app.set_default_format(true); while ((opt = poptGetNextOpt(ctx())) > 0) { @@ -360,11 +361,12 @@ break; case OPT_FORMAT: - app.set_fmtstring(string(argstr)); + app.set_default_format(false); + app.set_format_string(string(argstr)); break; case OPT_XML: - app.set_xml(); + app.set_xml_enabled(); break; case OPT_HELP: