[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-commits-diffs] net.venge.monotone.issue-120: 2e4450088b246a9f
From: |
code |
Subject: |
[Monotone-commits-diffs] net.venge.monotone.issue-120: 2e4450088b246a9fd74ee1c300e418db24e18b20 |
Date: |
Thu, 24 Feb 2011 17:30:35 +0100 (CET) |
revision: 2e4450088b246a9fd74ee1c300e418db24e18b20
date: 2011-02-24T13:29:45
author: Richard Hopkins <address@hidden>
branch: net.venge.monotone.issue-120
changelog:
revision_summary now takes a boost::function for getting the node summary
The 4 callers now pass in friendly_node_summary, so the output of "mtn
status" etc should be exactly the same as before. All that is left now is
for the call to revision_summary in CMD(changed to only output the unique
file_path's.
manifest:
format_version "1"
new_manifest [0306331db687bec5bbf55c1a1888ff7ca28988bd]
old_revision [a0ac86f3251528432cb25a9654d9da5245139c70]
patch "src/cmd_diff_log.cc"
from [94a354875b587d372e6d0898ab6fc8355ce29c21]
to [4a61bfb4b9c1066fcc650b2bc634ce582729ebb1]
patch "src/cmd_list.cc"
from [e3241a4bac5495f95ba880464d7de98a2ba4135c]
to [60ec6406130ae4d1f30348c72aff250116450483]
patch "src/cmd_ws_commit.cc"
from [7b91a53d8eec4e78b062092f85c945bbaaefe23a]
to [9a9d30688c6a62be6568758d004b5aa3a8c89ee5]
patch "src/rev_output.cc"
from [a9e63eb281ed57ac1ea7e0968722d3d5650e4e17]
to [2a503773d632fdcd5629acd2404f0bdbec2fb4b0]
patch "src/rev_output.hh"
from [89157d5665d2334066a440de70d6a653a6db2c6b]
to [6d5263e826dac07b647fccca09062d3598384f3f]
============================================================
--- src/cmd_diff_log.cc 94a354875b587d372e6d0898ab6fc8355ce29c21
+++ src/cmd_diff_log.cc 4a61bfb4b9c1066fcc650b2bc634ce582729ebb1
@@ -587,7 +587,7 @@ log_print_rev (app_state & app,
if (!app.opts.no_files)
{
utf8 summary;
- revision_summary(rev, summary);
+ revision_summary(rev, summary, friendly_node_summary);
external summary_external;
utf8_to_system_best_effort(summary, summary_external);
out << summary_external;
============================================================
--- src/cmd_list.cc e3241a4bac5495f95ba880464d7de98a2ba4135c
+++ src/cmd_list.cc 60ec6406130ae4d1f30348c72aff250116450483
@@ -884,7 +884,7 @@ CMD(changed, "changed", "", CMD_REF(list
// add the output to a set for ignoring duplicates, but CMD(status can
// output the info in a friendly format
utf8 summary;
- revision_summary(rev, summary);
+ revision_summary(rev, summary, friendly_node_summary);
cout << summary;
}
============================================================
--- src/cmd_ws_commit.cc 7b91a53d8eec4e78b062092f85c945bbaaefe23a
+++ src/cmd_ws_commit.cc 9a9d30688c6a62be6568758d004b5aa3a8c89ee5
@@ -259,7 +259,7 @@ get_log_message_interactively(lua_hooks
}
utf8 summary;
- revision_summary(rev, summary);
+ revision_summary(rev, summary, friendly_node_summary);
utf8 full_message(changelog() + cancel() + instructions() + editable() + ignored() +
notes() + summary(),
@@ -968,7 +968,7 @@ CMD(status, "status", "", CMD_REF(inform
revision_header(rid, rev, author, date_t::now(), app.opts.branch, changelog,
date_fmt, header);
- revision_summary(rev, summary);
+ revision_summary(rev, summary, friendly_node_summary);
external header_external;
external summary_external;
============================================================
--- src/rev_output.cc a9e63eb281ed57ac1ea7e0968722d3d5650e4e17
+++ src/rev_output.cc 2a503773d632fdcd5629acd2404f0bdbec2fb4b0
@@ -167,7 +167,12 @@ void
}
void
-revision_summary(revision_t const & rev, utf8 & summary)
+revision_summary(revision_t const & rev, utf8 & summary,
+ boost::function<std::string(node_status const,
+ file_path const &,
+ file_path const &,
+ attr_key const &,
+ attr_value const &)> node_summary_fn)
{
// We intentionally do not collapse the final \n into the format
// strings here, for consistency with newline conventions used by most
@@ -199,33 +204,33 @@ revision_summary(revision_t const & rev,
for (set<file_path>::const_iterator i = cs.nodes_deleted.begin();
i != cs.nodes_deleted.end(); ++i)
- out << friendly_node_summary(dropped, *i, dummy_file, dummy_key,
+ out << node_summary_fn(dropped, *i, dummy_file, dummy_key,
dummy_value);
for (map<file_path, file_path>::const_iterator
i = cs.nodes_renamed.begin();
i != cs.nodes_renamed.end(); ++i)
- out << friendly_node_summary(renamed, i->first, i->second,
+ out << node_summary_fn(renamed, i->first, i->second,
dummy_key, dummy_value);
for (set<file_path>::const_iterator i = cs.dirs_added.begin();
i != cs.dirs_added.end(); ++i)
- out << friendly_node_summary(added, *i, dummy_file, dummy_key,
+ out << node_summary_fn(added, *i, dummy_file, dummy_key,
dummy_value);
for (map<file_path, file_id>::const_iterator i = cs.files_added.begin();
i != cs.files_added.end(); ++i)
- out << friendly_node_summary(added, i->first, dummy_file,
+ out << node_summary_fn(added, i->first, dummy_file,
dummy_key, dummy_value);
for (map<file_path, pair<file_id, file_id> >::const_iterator
i = cs.deltas_applied.begin(); i != cs.deltas_applied.end(); ++i)
- out << friendly_node_summary(patched, i->first, dummy_file,
+ out << node_summary_fn(patched, i->first, dummy_file,
dummy_key, dummy_value);
for (map<pair<file_path, attr_key>, attr_value >::const_iterator
i = cs.attrs_set.begin(); i != cs.attrs_set.end(); ++i)
- out << friendly_node_summary(attr_set, i->first.first, dummy_file,
+ out << node_summary_fn(attr_set, i->first.first, dummy_file,
i->first.second, i->second);
// FIXME: naming here could not be more inconsistent
@@ -236,7 +241,7 @@ revision_summary(revision_t const & rev,
for (set<pair<file_path, attr_key> >::const_iterator
i = cs.attrs_cleared.begin(); i != cs.attrs_cleared.end(); ++i)
- out << friendly_node_summary(attr_unset, i->first, dummy_file,
+ out << node_summary_fn(attr_unset, i->first, dummy_file,
i->second, dummy_value);
out << '\n';
============================================================
--- src/rev_output.hh 89157d5665d2334066a440de70d6a653a6db2c6b
+++ src/rev_output.hh 6d5263e826dac07b647fccca09062d3598384f3f
@@ -10,6 +10,8 @@
#ifndef __REV_SUMMARY_HH__
#define __REV_SUMMARY_HH__
+#include <boost/function.hpp>
+
#include "rev_types.hh"
#include "vocab.hh"
@@ -43,7 +45,12 @@ void
attr_value const & value);
void
-revision_summary(revision_t const & rev, utf8 & summary);
+revision_summary(revision_t const & rev, utf8 & summary,
+ boost::function<std::string(node_status const,
+ file_path const &,
+ file_path const &,
+ attr_key const &,
+ attr_value const &)> node_summary_fn);
#endif // header guard
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Monotone-commits-diffs] net.venge.monotone.issue-120: 2e4450088b246a9fd74ee1c300e418db24e18b20,
code <=