# # # patch "asciik.cc" # from [b87007365ea839ef1e1891debf74b33d526b6226] # to [227ea4c3e8da61866f7a3ebfc937ed561c057fce] # # patch "asciik.hh" # from [3ee4ae18281eedd799f1c98094c0cf0b762d6a35] # to [81731a9c0939c9e47e375ee780ec9bbb4da2a8b0] # ============================================================ --- asciik.cc b87007365ea839ef1e1891debf74b33d526b6226 +++ asciik.cc 227ea4c3e8da61866f7a3ebfc937ed561c057fce @@ -244,6 +244,9 @@ asciik::draw(const size_t curr_items, co lines.push_back(string("")); if (num_lines < 2) lines.push_back(string("")); + // ignore empty lines at the end + while ((num_lines > 2) && (lines[num_lines - 1].size() == 0)) + --num_lines; // prints it out output << line << " " << lines[0] << '\n'; @@ -352,9 +355,9 @@ asciik::print(const revision_id & rev, c curr_row = next_row; else if (new_revs.size() == 0) { // this line has disappeared vector extra_ghost(next_row); - extra_ghost.insert(curr_row.begin() + curr_loc, ghost); - if (!try_draw(extra_ghost, curr_loc, parents, annotation)) - I(false); + I(curr_loc < extra_ghost.size()); + extra_ghost.insert(extra_ghost.begin() + curr_loc, ghost); + I(try_draw(extra_ghost, curr_loc, parents, annotation)); curr_row = extra_ghost; } } ============================================================ --- asciik.hh 3ee4ae18281eedd799f1c98094c0cf0b762d6a35 +++ asciik.hh 81731a9c0939c9e47e375ee780ec9bbb4da2a8b0 @@ -11,6 +11,8 @@ public: public: asciik(size_t min_width = 0, std::ostream & os = std::cout); // Prints an ASCII-k chunk using the given revisions. + // Multiple lines are supported in annotation (the graph will stretch + // accordingly); empty newlines at the end will be removed. void print(const revision_id & rev, const std::set & parents, const string & annotation); //TODO: cambiare set-parents to vector-next