monotone

View dirty.patch

1#
2# old_revision [f7cea8d4e635f311b8c85257b8bfbaf38b961407]
3#
4# patch "src/cmd_list.cc"
5# from [a0103f85cfb0c0e36fe33f3bad41e321cf1d5dcc]
6# to [fbc3ba2d254dd046e1d39fe297ec75f232b6c192]
7#
8============================================================
9--- src/cmd_list.cca0103f85cfb0c0e36fe33f3bad41e321cf1d5dcc
10+++ src/cmd_list.ccfbc3ba2d254dd046e1d39fe297ec75f232b6c192
11@@ -23,6 +23,7 @@
12 #include "cmd.hh"
13 #include "roster.hh"
14 #include "database.hh"
15+#include "date_format.hh"
16 #include "globish.hh"
17 #include "keys.hh"
18 #include "key_store.hh"
19@@ -113,6 +114,8 @@ CMD(certs, "certs", "", CMD_REF(list), "
20
21 transaction_guard guard(db, false);
22
23+ string date_fmt = get_date_format(app.opts, app.lua, date_time_long);
24+
25 revision_id ident;
26 complete(app.opts, app.lua, project, idx(args, 0)(), ident);
27 vector<cert> ts;
28@@ -184,6 +187,11 @@ CMD(certs, "certs", "", CMD_REF(list), "
29 split_into_lines(washed, lines);
30 std::string value_first_line = lines.empty() ? "" : idx(lines, 0);
31
32+ if (idx(certs, i).name().compare("date") == 0)
33+ {
34+ value_first_line = date_t(value_first_line).as_formatted_localtime(date_fmt);
35+ }
36+
37 key_identity_info identity;
38 identity.id = idx(certs, i).key;
39 project.complete_key_identity_from_id(keys, app.lua, identity);
40@@ -1068,6 +1076,7 @@ CMD_AUTOMATE(certs, N_("REV"),
41 sort(certs.begin(), certs.end());
42
43 basic_io::printer pr;
44+ string date_fmt = get_date_format(app.opts, app.lua, date_time_long);
45
46 for (size_t i = 0; i < certs.size(); ++i)
47 {
48@@ -1105,8 +1114,14 @@ CMD_AUTOMATE(certs, N_("REV"),
49 }
50 st.push_str_pair(syms::signature, stat);
51
52+ string value = tv();
53+ if (name().compare("date") == 0)
54+ {
55+ value = date_t(tv()).as_formatted_localtime(date_fmt);
56+ }
57+
58 st.push_str_pair(syms::name, name());
59- st.push_str_pair(syms::value, tv());
60+ st.push_str_pair(syms::value, value);
61 st.push_str_pair(syms::trust, (trusted ? "trusted" : "untrusted"));
62
63 pr.print_stanza(st);

Archive Download this file

Attachment to issue 218

Created: 8 years 11 months ago by Frédéric Praca

Quick Links:     www.monotone.ca    -     Downloads    -     Documentation    -     Wiki    -     Code Forge    -     Build Status