Changeset 403 for trunk/lib/File.cc


Ignore:
Timestamp:
Jun 29, 2007, 1:23:12 AM (15 years ago)
Author:
Peter Johansson
Message:

fixes #160 - color coding different linetypes in blame output

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/File.cc

    r401 r403  
    8888    os << "<thead>\n";
    8989    os << "<tr>\n";
    90     os << "<th class=\"number\">Rev</th>\n";
     90    os << "<th class=\"rev\">Rev</th>\n";
    9191    os << "<th class=\"date\">Date</th>\n";
    9292    os << "<th class=\"author\">Author</th>\n";
    93     os << "<th class=\"number\">Line</th>\n";
     93    os << "<th class=\"line\">Line</th>\n";
    9494    os << "<th></th>\n";
    9595    os << "</tr>\n</thead>\n";
     
    9797    HtmlStream hs(os);
    9898    SVNblame blame(path_);
     99    Parser parser(path_);
     100    std::vector<Parser::line_type>::const_iterator
     101      line_type(parser.type().begin());
    99102    int last=0;
    100103    int first=0;
     
    118121      else
    119122        color = hex(static_cast<int>(k*blame.revision()+m),2);
    120       os << "<tr>\n<td class=\"number\"><font color=\"#" << color
     123      os << "<tr>\n<td class=\"rev\"><font color=\"#" << color
    121124         << color << color << "\">" << blame.revision()
    122125         << "</font></td>\n<td class=\"date\"><font color=\"#" << color
     
    125128      os << "</font></td>\n<td class=\"author\">";
    126129      hs << blame.author();
    127       os << "</td>\n<td class=\"number\">" << blame.line_no()+1
     130      os << "</td>\n<td class=\"";
     131      assert(line_type!=parser.type().end());
     132      if (*line_type==Parser::empty)
     133        os << "line-other";
     134      else if (*line_type==Parser::comment)
     135        os << "line-comment";
     136      else
     137        os << "line-code";
     138      os << "\">" << blame.line_no()+1
    128139         << "</td>\n<td>";
    129140      hs << blame.line();
    130141      os << "</td>\n</tr>\n";
    131142      blame.next_line();
     143      ++line_type;
    132144    }
    133145    os << "</tbody>\n";
Note: See TracChangeset for help on using the changeset viewer.