[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-commits-diffs] net.venge.monotone.issue-120: ebbf78482331fd3a
From: |
code |
Subject: |
[Monotone-commits-diffs] net.venge.monotone.issue-120: ebbf78482331fd3a4561cad0762cdaf92b2cf527 |
Date: |
Thu, 24 Feb 2011 17:30:45 +0100 (CET) |
revision: ebbf78482331fd3a4561cad0762cdaf92b2cf527
date: 2011-02-24T10:22:34
author: Richard Hopkins <address@hidden>
branch: net.venge.monotone.issue-120
changelog:
friendly_node_summary now handles attribute un/set
revision_summary now calls friendly_node_summary for the attribute changes
and passes in dummy attr_key/attr_value values for the other cases such as
added files.
manifest:
format_version "1"
new_manifest [672103eca99a848b2252a3c2e7c8ef1578d40bc2]
old_revision [3047e8cec70b30acb48b2b0f8ff06b80a9c0197e]
patch "src/rev_output.cc"
from [824372b09f7808e81a05d3279c5ef024b71766e2]
to [47b3eb5059cd4628dff0b8133adc362f57ce50b1]
patch "src/rev_output.hh"
from [2451927b672030dde2542360648295ad49168d54]
to [89157d5665d2334066a440de70d6a653a6db2c6b]
============================================================
--- src/rev_output.cc 824372b09f7808e81a05d3279c5ef024b71766e2
+++ src/rev_output.cc 47b3eb5059cd4628dff0b8133adc362f57ce50b1
@@ -121,7 +121,8 @@ friendly_node_summary(node_status const
string
friendly_node_summary(node_status const status, file_path const & fp_first,
- file_path const & fp_second)
+ file_path const & fp_second, attr_key const & key,
+ attr_value const & value)
{
ostringstream out;
@@ -144,24 +145,17 @@ friendly_node_summary(node_status const
out << (F(" patched %s") % fp_first);
break;
- /*TODO: for (map<pair<file_path, attr_key>, attr_value >::const_iterator
- i = cs.attrs_set.begin(); i != cs.attrs_set.end(); ++i)
+ case attr_set:
out << (F(" attr on %s\n"
" set %s\n"
" to %s")
- % i->first.first % i->first.second % i->second) << '\n';
+ % fp_first % key % value);
+ break;
- // FIXME: naming here could not be more inconsistent
- // the cset calls it attrs_cleared
- // the command is attr drop
- // here it is called unset
- // the revision text uses attr clear
-
- for (set<pair<file_path, attr_key> >::const_iterator
- i = cs.attrs_cleared.begin(); i != cs.attrs_cleared.end(); ++i)
+ case attr_unset:
out << (F(" attr on %s\n"
- " unset %s") % i->first % i->second) << '\n';
- */
+ " unset %s") % fp_first % key) << '\n';
+ break;
default:
I(false); // should never get here
@@ -183,6 +177,9 @@ revision_summary(revision_t const & rev,
revision_id rid;
calculate_ident(rev, rid);
+ attr_key dummy_key;
+ attr_value dummy_value;
+
for (edge_map::const_iterator i = rev.edges.begin(); i != rev.edges.end(); ++i)
{
revision_id parent = edge_old_revision(*i);
@@ -201,31 +198,34 @@ 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, *i);
+ out << friendly_node_summary(dropped, *i, *i, 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 << friendly_node_summary(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, *i);
+ out << friendly_node_summary(added, *i, *i, 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, i->first);
+ out << friendly_node_summary(added, i->first, i->first,
+ 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, i->first);
+ out << friendly_node_summary(patched, i->first, i->first,
+ 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 << (F(" attr on %s\n"
- " set %s\n"
- " to %s")
- % i->first.first % i->first.second % i->second) << '\n';
+ out << friendly_node_summary(attr_set, i->first.first, i->first.first,
+ i->first.second, i->second);
// FIXME: naming here could not be more inconsistent
// the cset calls it attrs_cleared
@@ -235,8 +235,8 @@ 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 << (F(" attr on %s\n"
- " unset %s") % i->first % i->second) << '\n';
+ out << friendly_node_summary(attr_unset, i->first, i->first,
+ i->second, dummy_value);
out << '\n';
}
============================================================
--- src/rev_output.hh 2451927b672030dde2542360648295ad49168d54
+++ src/rev_output.hh 89157d5665d2334066a440de70d6a653a6db2c6b
@@ -39,7 +39,8 @@ friendly_node_summary(node_status const
std::string
friendly_node_summary(node_status const status, file_path const & fp_first,
- file_path const & fp_second);
+ file_path const & fp_second, attr_key const & key,
+ attr_value const & value);
void
revision_summary(revision_t const & rev, utf8 & summary);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Monotone-commits-diffs] net.venge.monotone.issue-120: ebbf78482331fd3a4561cad0762cdaf92b2cf527,
code <=