#
# patch "ChangeLog"
# from [87d013ff3ceb49047e93e0a8872d961d7f4db80d]
# to [d6b4434a4e6ec32a93d6bf19ee4f3a0059a44ee3]
#
# patch "commands.cc"
# from [4f0bdd287f9a5e2a34d7bd96b404107c27286f6a]
# to [6d0fcee02e8a6a5414aeb91ba5d23a548dc91b3d]
#
# patch "tests/t_tags.at"
# from [695cbeefa0c5d77279268624fd623b65a815ad4a]
# to [a1e2ed2a4041deb483c77b183818d50c773cd071]
#
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,8 @@
+2005-04-29 Nathaniel Smith
+
+ * commands.cc (ls_tags): Sort output.
+ * tests/t_tags.at: Test that output is sorted.
+
2005-04-29 Emile Snyder
* annotate.cc (do_annotate_node): Stop doing expensive
--- commands.cc
+++ commands.cc
@@ -1755,14 +1755,21 @@
vector< revision > certs;
app.db.get_revision_certs(tag_cert_name, certs);
+ std::map > sorted_certs;
+
for (size_t i = 0; i < certs.size(); ++i)
{
cert_value name;
decode_base64(idx(certs, i).inner().value, name);
- cout << name << " "
- << idx(certs,i).inner().ident << " "
- << idx(certs,i).inner().key << endl;
+ sorted_certs.insert(std::make_pair(name, idx(certs, i)));
}
+ for (std::map >::const_iterator i = sorted_certs.begin();
+ i != sorted_certs.end(); ++i)
+ {
+ cout << i->first << " "
+ << i->second.inner().ident << " "
+ << i->second.inner().key << endl;
+ }
}
static void
--- tests/t_tags.at
+++ tests/t_tags.at
@@ -38,6 +38,10 @@
AT_CHECK(grep tag1 stdout, [], [ignore], [ignore])
AT_CHECK(grep tag2 stdout, [], [ignore], [ignore])
AT_CHECK(grep tag3 stdout, [], [ignore], [ignore])
+# make sure 'ls tags' sorts output is sorted
+AT_CHECK(CANONICALISE(stdout))
+AT_CHECK(sort sorted-stdout)
+AT_CHECK(cmp stdout sorted-stdout)
AT_CHECK(rm -rf MT file1 file2 file3)