[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-commits-diffs] net.venge.monotone.colored-diff: 86c803294d687
From: |
code |
Subject: |
[Monotone-commits-diffs] net.venge.monotone.colored-diff: 86c803294d687290901ebbf1cf2f2196c2faf83d |
Date: |
Wed, 12 Jan 2011 23:08:54 GMT |
revision: 86c803294d687290901ebbf1cf2f2196c2faf83d
date: 2011-01-12T23:04:26
author: Richard Hopkins
branch: net.venge.monotone.colored-diff
changelog:
Fixes for compile errors caused by propagate in diff_output.cc
I forgot to merge across the stringstream library and calls to
add the output into a stringstream, before it's finally displayed.
See unidiff_hunk_writer::flush_hunk.
The stringstream version originates from the nvm.colored-diff
branch.
The propagate keeps everything else from the nvm branch including
the bug fix in make_diff - when removing a file.
manifest:
format_version "1"
new_manifest [6c79adbc2bed3658ed54b5a48725cf8f157ae04f]
old_revision [a7c454e212655d40baf2fbe86b35d8ec3628c1d0]
patch "diff_output.cc"
from [755e111048701234e0a303023d262332e3753621]
to [9aab77314ce27866f7fee966936480d03fa13220]
============================================================
--- diff_output.cc 755e111048701234e0a303023d262332e3753621
+++ diff_output.cc 9aab77314ce27866f7fee966936480d03fa13220
@@ -17,6 +17,7 @@
#include "simplestring_xform.hh"
#include <ostream>
+#include <sstream>
#include <iterator>
#include <boost/scoped_ptr.hpp>
@@ -25,6 +26,7 @@ using std::string;
using std::ostream;
using std::ostream_iterator;
using std::string;
+using std::stringstream;
using std::vector;
using boost::scoped_ptr;
@@ -208,22 +210,23 @@ void unidiff_hunk_writer::flush_hunk(siz
}
// write hunk to stream
+ stringstream ss;
if (a_len == 0)
- ost << "@@ -0,0";
+ ss << "@@ -0,0";
else
{
- ost << "@@ -" << a_begin+1;
+ ss << "@@ -" << a_begin+1;
if (a_len > 1)
- ost << ',' << a_len;
+ ss << ',' << a_len;
}
-
+
if (b_len == 0)
- ost << " +0,0";
+ ss << " +0,0";
else
{
- ost << " +" << b_begin+1;
+ ss << " +" << b_begin+1;
if (b_len > 1)
- ost << ',' << b_len;
+ ss << ',' << b_len;
}
{
@@ -238,7 +241,7 @@ void unidiff_hunk_writer::flush_hunk(siz
}
find_encloser(a_begin + first_mod, encloser);
- ost << " @@" << encloser << '\n';
+ ss << " @@";
ost << color.colorize(ss.str(), colorizer::diff_separator);
ost << color.colorize(encloser, colorizer::diff_encloser);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Monotone-commits-diffs] net.venge.monotone.colored-diff: 86c803294d687290901ebbf1cf2f2196c2faf83d,
code <=