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: 3574c6eedde8ff


From: code
Subject: [Monotone-commits-diffs] net.venge.monotone.colored-diff: 3574c6eedde8ff607f303be67dda04048f882e13
Date: Mon, 11 Apr 2011 22:45:19 +0200 (CEST)

revision:            3574c6eedde8ff607f303be67dda04048f882e13
date:                2011-04-10T21:33:37
author:              Richard Hopkins <address@hidden>
branch:              net.venge.monotone.colored-diff
changelog:
More foundation for colorized output

This commit actually breaks the output, due to some output going directly
through cout, and others being buffered into stringstreams whilst others
are going through the colorizer.

The gameplan is to make all output go through the same place, to keep
everything in sync, which will help us colorize.

manifest:
format_version "1"

new_manifest [a941b1c2c772c1c3b9072bfe2add06379ff723dc]

old_revision [973e5397a57f2f09b049cca8c368008cd8d1f05f]

patch "src/colorizer.cc"
 from [faab445c678b6f93119254030a38bb905ab7d89e]
   to [c4a84f8e4ae26c763df6d57ac3f6c11f48ad6fbf]
============================================================
--- src/colorizer.cc	faab445c678b6f93119254030a38bb905ab7d89e
+++ src/colorizer.cc	c4a84f8e4ae26c763df6d57ac3f6c11f48ad6fbf
@@ -264,10 +264,16 @@ colorizer::colorize(string const & in, p
   if (enabled)
     {
       I(colormap.find(p) != colormap.end());
-      return change_format(p) + in + change_format(reset);
+      out << change_format(p) << in << change_format(reset);
     }
   else
-    return in;
+    out << in;
+  
+  // so we can be used by callers like ...
+  // color.get_output() << color.colorize("new_file.txt", add) << "\n";
+  // we need to return empty, as to not duplicate output and let the
+  // callers have the ability to have minimal changes and keep readbility.
+  return "";
 }
 
 template<typename T>

reply via email to

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