monotone-commits-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Monotone-commits-diffs] net.venge.monotone: b34d9438297eda705f7e736983e


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone: b34d9438297eda705f7e736983e2d7fdce46c394
Date: Tue, 4 Dec 2012 22:34:04 +0100 (CET)

revision:            b34d9438297eda705f7e736983e2d7fdce46c394
date:                2012-12-04T21:30:13
author:              address@hidden
branch:              net.venge.monotone
changelog:
- Fix #218 : take into account the date format in 'automate certs' and 'ls 
certs' commands

manifest:
format_version "1"

new_manifest [a41a3a1e2eda38be59976f4e9503b79d548d333e]

old_revision [34fc6a1436ca1b0435d55ae4b44a1803f1a81491]

patch "src/cmd_list.cc"
 from [a0103f85cfb0c0e36fe33f3bad41e321cf1d5dcc]
   to [2fd51c7a2d8edd949a7e262085988ad3124dc135]
============================================================
--- src/cmd_list.cc	a0103f85cfb0c0e36fe33f3bad41e321cf1d5dcc
+++ src/cmd_list.cc	2fd51c7a2d8edd949a7e262085988ad3124dc135
@@ -23,6 +23,7 @@
 #include "cmd.hh"
 #include "roster.hh"
 #include "database.hh"
+#include "date_format.hh"
 #include "globish.hh"
 #include "keys.hh"
 #include "key_store.hh"
@@ -113,6 +114,8 @@ CMD(certs, "certs", "", CMD_REF(list), "
 
   transaction_guard guard(db, false);
 
+  string date_fmt = get_date_format(app.opts, app.lua, date_time_long);
+
   revision_id ident;
   complete(app.opts, app.lua,  project, idx(args, 0)(), ident);
   vector<cert> ts;
@@ -184,6 +187,11 @@ CMD(certs, "certs", "", CMD_REF(list), "
       split_into_lines(washed, lines);
       std::string value_first_line = lines.empty() ? "" : idx(lines, 0);
 
+      if (idx(certs, i).name == date_cert_name)
+        {
+          value_first_line = date_t(value_first_line).as_formatted_localtime(date_fmt);
+        }
+
       key_identity_info identity;
       identity.id = idx(certs, i).key;
       project.complete_key_identity_from_id(keys, app.lua, identity);
@@ -1068,6 +1076,7 @@ CMD_AUTOMATE(certs, N_("REV"),
   sort(certs.begin(), certs.end());
 
   basic_io::printer pr;
+  string date_fmt = get_date_format(app.opts, app.lua, date_time_long);
 
   for (size_t i = 0; i < certs.size(); ++i)
     {
@@ -1105,8 +1114,14 @@ CMD_AUTOMATE(certs, N_("REV"),
         }
       st.push_str_pair(syms::signature, stat);
 
+      string value = tv();
+      if (name == date_cert_name)
+        {
+          value = date_t(tv()).as_formatted_localtime(date_fmt);
+        }
+      
       st.push_str_pair(syms::name, name());
-      st.push_str_pair(syms::value, tv());
+      st.push_str_pair(syms::value, value);
       st.push_str_pair(syms::trust, (trusted ? "trusted" : "untrusted"));
 
       pr.print_stanza(st);

reply via email to

[Prev in Thread] Current Thread [Next in Thread]