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.colored-diff: 6e3fa1d7e3ac9e


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone.colored-diff: 6e3fa1d7e3ac9e535ae4343b56950afa1139275b
Date: Wed, 13 Apr 2011 00:02:28 +0200 (CEST)

revision:            6e3fa1d7e3ac9e535ae4343b56950afa1139275b
date:                2011-04-12T21:35:24
author:              Richard Hopkins <address@hidden>
branch:              net.venge.monotone.colored-diff
changelog:
Removed unused string parameter for output in revision_header and 
revision_summary

All output in the functions went through the colorizer, so they are no
longer needed. At the same time, remove uses of the variables on the caller
side as the contents were empty anyway.

With all output going through the colorizer, I suspect this could make
things easier to handle with utf8 conversion for output.

manifest:
format_version "1"

new_manifest [959385b51af94f218291b42c4ecb19d8b67f77c1]

old_revision [58ed8031aea2b70ea6e04c631afc9823e6ceafe2]

patch "src/cmd_diff_log.cc"
 from [c9aa40fd997f22a53476a25b6ca5a85593294c7e]
   to [edf24cc63f8190b819b96ae3464010960bdebdf0]

patch "src/cmd_ws_commit.cc"
 from [1dfba0b1f84506cd781e74448fe3b780e6fc5051]
   to [97997cf92634c8b79fc7cd357f3b44895643a066]

patch "src/rev_output.cc"
 from [ccf235daf27df22af61326c746170ff3fccb075a]
   to [64f4b7b653880084f21ca8ad4885f026ef87d74b]

patch "src/rev_output.hh"
 from [5879a8268a59545c946583b65f66eda4491b979e]
   to [5d2c0b05bcc9c3324715fc7dfbc9c5cdea9f16a3]
============================================================
--- src/cmd_diff_log.cc	c9aa40fd997f22a53476a25b6ca5a85593294c7e
+++ src/cmd_diff_log.cc	edf24cc63f8190b819b96ae3464010960bdebdf0
@@ -594,20 +594,11 @@ log_print_rev (app_state    &   app,
     }
   else
     {
-      utf8 header;
-      revision_header(rid, rev, certs, date_fmt, color, header);
+      revision_header(rid, rev, certs, date_fmt, color);
 
-      external header_external;
-      utf8_to_system_best_effort(header, header_external);
-      color.get_ostream() << header_external;
-
       if (!app.opts.no_files)
         {
-          utf8 summary;
-          revision_summary(rev, color, summary);
-          external summary_external;
-          utf8_to_system_best_effort(summary, summary_external);
-          color.get_ostream() << summary_external;
+          revision_summary(rev, color);
         }
     }
 
============================================================
--- src/cmd_ws_commit.cc	1dfba0b1f84506cd781e74448fe3b780e6fc5051
+++ src/cmd_ws_commit.cc	97997cf92634c8b79fc7cd357f3b44895643a066
@@ -261,7 +261,7 @@ get_log_message_interactively(lua_hooks 
   utf8 summary;
   ostringstream oss;
   colorizer color(false, lua, oss);
-  revision_summary(rev, color, summary);
+  revision_summary(rev, color);
   summary = utf8(oss.str().c_str());
 
   utf8 full_message(changelog() + cancel() + instructions() + editable() + ignored() +
@@ -966,22 +966,12 @@ CMD(status, "status", "", CMD_REF(inform
   utf8 changelog;
   work.read_user_log(changelog);
 
-  utf8 header;
-  utf8 summary;
   colorizer color(app.opts.colorize, app.lua, cout);
 
   revision_header(rid, rev, author, date_t::now(), app.opts.branch, changelog,
-                  date_fmt, color, header);
-  revision_summary(rev, color, summary);
+                  date_fmt, color);
+  revision_summary(rev, color);
 
-  external header_external;
-  external summary_external;
-
-  utf8_to_system_best_effort(header, header_external);
-  utf8_to_system_best_effort(summary, summary_external);
-
-  cout << header_external;
-
   if (!old_branches.empty() &&
       old_branches.find(app.opts.branch) == old_branches.end())
     {
@@ -1006,8 +996,6 @@ CMD(status, "status", "", CMD_REF(inform
             }
         }
     }
-
-  cout << summary_external;
 }
 
 static void
============================================================
--- src/rev_output.cc	ccf235daf27df22af61326c746170ff3fccb075a
+++ src/rev_output.cc	64f4b7b653880084f21ca8ad4885f026ef87d74b
@@ -31,7 +31,7 @@ revision_header(revision_id const rid, r
 revision_header(revision_id const rid, revision_t const & rev,
                 string const & author, date_t const date,
                 branch_name const & branch, utf8 const & changelog,
-                string const & date_fmt, colorizer const & color, utf8 & header)
+                string const & date_fmt, colorizer const & color)
 {
   vector<cert> certs;
   key_id empty_key;
@@ -47,13 +47,13 @@ revision_header(revision_id const rid, r
     certs.push_back(cert(rid, changelog_cert_name,
                          cert_value(changelog(), origin::user), empty_key));
 
-  revision_header(rid, rev, certs, date_fmt, color, header);
+  revision_header(rid, rev, certs, date_fmt, color);
 }
 
 void
 revision_header(revision_id const rid, revision_t const & rev,
                 vector<cert> const & certs, string const & date_fmt,
-                colorizer const & color, utf8 & header)
+                colorizer const & color)
 {
   color.get_ostream() << color.colorize(string(70, '-'),
                                         colorizer::log_revision) << '\n';
@@ -124,7 +124,7 @@ void
 }
 
 void
-revision_summary(revision_t const & rev, colorizer const & color, utf8 & summary)
+revision_summary(revision_t const & rev, colorizer const & color)
 {
   // We intentionally do not collapse the final \n into the format
   // strings here, for consistency with newline conventions used by most
============================================================
--- src/rev_output.hh	5879a8268a59545c946583b65f66eda4491b979e
+++ src/rev_output.hh	5d2c0b05bcc9c3324715fc7dfbc9c5cdea9f16a3
@@ -21,16 +21,15 @@ revision_header(revision_id const rid, r
 revision_header(revision_id const rid, revision_t const & rev,
                 std::string const & author, date_t const date,
                 branch_name const & branch, utf8 const & changelog,
-                std::string const & date_fmt, colorizer const & color,
-                utf8 & header);
+                std::string const & date_fmt, colorizer const & color);
 
 void
 revision_header(revision_id const rid, revision_t const & rev,
                 std::vector<cert> const & certs, std::string const & date_fmt,
-                colorizer const & color, utf8 & header);
+                colorizer const & color);
 
 void
-revision_summary(revision_t const & rev, colorizer const & color, utf8 & summary);
+revision_summary(revision_t const & rev, colorizer const & color);
 
 #endif  // header guard
 

reply via email to

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