#
#
# patch "ChangeLog"
# from [c88c3c75b6c954bde9a6d6b745c234b0aa89b950]
# to [1dc063ed4c2cea74c955698bddbe353ed29a96dd]
#
# patch "cert.cc"
# from [6e1ffc5b990cf82e6ee2a7d1492127b2f71aa105]
# to [55d8e1bba7293f30447e0b095a3687aec5012cae]
#
# patch "cert.hh"
# from [6ccf880b677340a2460ced453c93700b7bae07b3]
# to [7fd1b8cafa9903cfb85096c35eb3c3fc81a27950]
#
# patch "charset.cc"
# from [f55e73d42872fbbf269b3cd9f41af9217030f1a6]
# to [14902c1707dc7419e76ce33d79e338e3e1cf21dd]
#
# patch "charset.hh"
# from [e4f776a4afa20b3a770e0a6ac87824ebd24232ef]
# to [020f1f2f1e84806b0f854067e8673d1ca990206f]
#
# patch "cleanup.hh"
# from [a450ba2ba4311f0a298c1e102bd5c5f0c5fb2258]
# to [988ba5a0718b4329477c239985624410af1b8424]
#
# patch "cmd.hh"
# from [76fe4ececf8426484d8a4aca7c54237c49ce6100]
# to [011931fc896ddad4191df829d098bd1c6160abf9]
#
# patch "cmd_automate.cc"
# from [37baff9dc561c7fad66b88559fda15b14f2a4f55]
# to [f15afa4d2da31e9aa10bbfe6cef515774a12d274]
#
# patch "cmd_db.cc"
# from [7403b1a1bb54a12e01dee5fcbbc3db7aaf8ba557]
# to [d548a1b04279282574eb36cda7e014f2ea2af2a6]
#
# patch "cmd_diff_log.cc"
# from [c2d375111f402eac0c82134f174627d88608dcb0]
# to [33b0edc161f98dee63891225132d6276c9909e7d]
#
# patch "cmd_files.cc"
# from [22b692fc7848cf47a7572d4df48b0ffeeaa56c5c]
# to [06a9ad1c80d6604a4d1a1414ebbce0c1790d2924]
#
# patch "cmd_key_cert.cc"
# from [4f07a55505d99f4a1680313d47e7a813a4bd1517]
# to [b965380d94873ec7db8d59d0795151d2d02eb9e9]
#
# patch "cmd_list.cc"
# from [5edf0ae19d13ccc9d25490eb64576bff4ad907ca]
# to [88ec6d14089ab074f8eb702f6e16f39a1399be53]
#
# patch "cmd_merging.cc"
# from [6745bfc6317dad3cf1828d17600aca164accf0e5]
# to [78a4f272c04de0799fca5e16a2262536fce14e7a]
#
# patch "cmd_othervcs.cc"
# from [47651b6f63bd48be121a30eec4d1746238151fd2]
# to [5666f47510818cfd78256dbf3696b49090b9c877]
#
# patch "cmd_packet.cc"
# from [0d127531d08a403249ba6fea64f09ee1fd0546e3]
# to [3ecd60dca3061099e393d432707a9bf82d3793e9]
#
# patch "cmd_ws_commit.cc"
# from [b334deaf56946d327559cb7db10fc82de170da5c]
# to [6afeacc30eb66fab0b3d6ba7494a01358a26bb7b]
#
============================================================
--- ChangeLog c88c3c75b6c954bde9a6d6b745c234b0aa89b950
+++ ChangeLog 1dc063ed4c2cea74c955698bddbe353ed29a96dd
@@ -1,3 +1,8 @@
+2006-06-03 Graydon Hoare
+
+ * {cert,charset,cleanup,cmd*}.{cc,hh}: Coppyright and formatting
+ fixes.
+
2006-06-01 Matthew Gregan
* visualc/monotone.vcproj: Add win32/os_strerror.cc to project.
============================================================
--- cert.cc 6e1ffc5b990cf82e6ee2a7d1492127b2f71aa105
+++ cert.cc 55d8e1bba7293f30447e0b095a3687aec5012cae
@@ -1,22 +1,16 @@
-// -*- mode: C++; c-file-style: "gnu"; indent-tabs-mode: nil -*-
-// copyright (C) 2002, 2003 graydon hoare
-// all rights reserved.
-// licensed to the public under the terms of the GNU GPL (>= 2)
-// see the file COPYING for details
+// Copyright (C) 2002 Graydon Hoare
+//
+// This program is made available under the GNU GPL version 2.0 or
+// greater. See the accompanying file COPYING for details.
+//
+// This program is distributed WITHOUT ANY WARRANTY; without even the
+// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE.
-#include "constants.hh"
-#include "cert.hh"
-#include "packet.hh"
-#include "app_state.hh"
-#include "interner.hh"
-#include "keys.hh"
-#include "netio.hh"
-#include "sanity.hh"
-#include "transforms.hh"
-#include "simplestring_xform.hh"
-#include "ui.hh"
-#include "options.hh"
-#include "revision.hh"
+#include
+#include
+#include
+#include
#include
#include
@@ -25,10 +19,19 @@
#include
#include
-#include
-#include
-#include
-#include
+#include "app_state.hh"
+#include "cert.hh"
+#include "constants.hh"
+#include "interner.hh"
+#include "keys.hh"
+#include "netio.hh"
+#include "options.hh"
+#include "packet.hh"
+#include "revision.hh"
+#include "sanity.hh"
+#include "simplestring_xform.hh"
+#include "transforms.hh"
+#include "ui.hh"
using std::make_pair;
using std::map;
@@ -42,7 +45,9 @@
using boost::tuple;
using boost::lexical_cast;
-// The alternaive is to #include "cert.hh" in vocab.*, which is even uglier.
+// The alternaive is to #include "cert.hh" in vocab.*, which is even
+// uglier.
+
#include "vocab_macros.hh"
cc_DECORATE(revision)
cc_DECORATE(manifest)
@@ -74,7 +79,8 @@
{
string txt;
cert_signable_text(c, txt);
- W(F("ignoring bad signature by '%s' on '%s'\n") % c.key() % txt);
+ W(F("ignoring bad signature by '%s' on '%s'\n")
+ % c.key() % txt);
return true;
}
else
@@ -82,7 +88,8 @@
I(status == cert_unknown);
string txt;
cert_signable_text(c, txt);
- W(F("ignoring unknown signature by '%s' on '%s'\n") % c.key() % txt);
+ W(F("ignoring unknown signature by '%s' on '%s'\n")
+ % c.key() % txt);
return true;
}
}
@@ -109,14 +116,17 @@
vector< manifest > tmp_certs;
- // sorry, this is a crazy data structure
+ // Sorry, this is a crazy data structure
typedef tuple< hexenc, cert_name, base64 > trust_key;
- typedef map< trust_key, pair< shared_ptr< set >, it > > trust_map;
+ typedef map< trust_key,
+ pair< shared_ptr< set >, it > > trust_map;
trust_map trust;
for (it i = certs.begin(); i != certs.end(); ++i)
{
- trust_key key = trust_key(i->inner().ident, i->inner().name, i->inner().value);
+ trust_key key = trust_key(i->inner().ident,
+ i->inner().name,
+ i->inner().value);
trust_map::iterator j = trust.find(key);
shared_ptr< set > s;
if (j == trust.end())
@@ -139,14 +149,20 @@
get<1>(i->first),
decoded_value))
{
- L(FL("trust function liked %d signers of %s cert on manifest %s\n")
- % i->second.first->size() % get<1>(i->first) % get<0>(i->first));
+ L(FL("trust function liked %d signers of %s "
+ "cert on manifest %s\n")
+ % i->second.first->size()
+ % get<1>(i->first)
+ % get<0>(i->first));
tmp_certs.push_back(*(i->second.second));
}
else
{
- W(F("trust function disliked %d signers of %s cert on manifest %s\n")
- % i->second.first->size() % get<1>(i->first) % get<0>(i->first));
+ W(F("trust function disliked %d signers of %s "
+ "cert on manifest %s\n")
+ % i->second.first->size()
+ % get<1>(i->first)
+ % get<0>(i->first));
}
}
certs = tmp_certs;
@@ -163,13 +179,17 @@
vector< revision > tmp_certs;
// sorry, this is a crazy data structure
- typedef tuple< hexenc, cert_name, base64 > trust_key;
- typedef map< trust_key, pair< shared_ptr< set >, it > > trust_map;
+ typedef tuple< hexenc,
+ cert_name, base64 > trust_key;
+ typedef map< trust_key,
+ pair< shared_ptr< set >, it > > trust_map;
trust_map trust;
for (it i = certs.begin(); i != certs.end(); ++i)
{
- trust_key key = trust_key(i->inner().ident, i->inner().name, i->inner().value);
+ trust_key key = trust_key(i->inner().ident,
+ i->inner().name,
+ i->inner().value);
trust_map::iterator j = trust.find(key);
shared_ptr< set > s;
if (j == trust.end())
@@ -192,14 +212,20 @@
get<1>(i->first),
decoded_value))
{
- L(FL("trust function liked %d signers of %s cert on revision %s\n")
- % i->second.first->size() % get<1>(i->first) % get<0>(i->first));
+ L(FL("trust function liked %d signers of %s "
+ "cert on revision %s\n")
+ % i->second.first->size()
+ % get<1>(i->first)
+ % get<0>(i->first));
tmp_certs.push_back(*(i->second.second));
}
else
{
- W(F("trust function disliked %d signers of %s cert on revision %s\n")
- % i->second.first->size() % get<1>(i->first) % get<0>(i->first));
+ W(F("trust function disliked %d signers of %s "
+ "cert on revision %s\n")
+ % i->second.first->size()
+ % get<1>(i->first)
+ % get<0>(i->first));
}
}
certs = tmp_certs;
@@ -212,17 +238,17 @@
{}
cert::cert(hexenc const & ident,
- cert_name const & name,
- base64 const & value,
- rsa_keypair_id const & key)
+ cert_name const & name,
+ base64 const & value,
+ rsa_keypair_id const & key)
: ident(ident), name(name), value(value), key(key)
{}
cert::cert(hexenc const & ident,
- cert_name const & name,
- base64 const & value,
- rsa_keypair_id const & key,
- base64 const & sig)
+ cert_name const & name,
+ base64 const & value,
+ rsa_keypair_id const & key,
+ base64 const & sig)
: ident(ident), name(name), value(value), key(key), sig(sig)
{}
@@ -236,7 +262,8 @@
|| ((((ident == other.ident) && name == other.name)
&& value == other.value) && key < other.key)
|| (((((ident == other.ident) && name == other.name)
- && value == other.value) && key == other.key) && sig < other.sig);
+ && value == other.value) && key == other.key)
+ && sig < other.sig);
}
bool
@@ -250,7 +277,7 @@
&& (sig == other.sig);
}
-// netio support
+// Netio support.
void
read_cert(string const & in, cert & t)
@@ -318,9 +345,10 @@
void
cert_signable_text(cert const & t,
- string & out)
+ string & out)
{
- out = (FL("address@hidden:%s]") % t.name % t.ident % remove_ws(t.value())).str();
+ out = (FL("address@hidden:%s]")
+ % t.name % t.ident % remove_ws(t.value())).str();
L(FL("cert: signable text %s\n") % out);
}
@@ -346,6 +374,7 @@
// Loads a key pair for a given key id, from either a lua hook
// or the key store. This will bomb out if the same keyid exists
// in both with differing contents.
+
void
load_key_pair(app_state & app,
rsa_keypair_id const & id,
@@ -355,7 +384,6 @@
static map keys;
bool persist_ok = (!keys.empty()) || app.lua.hook_persist_phrase_ok();
-
if (persist_ok && keys.find(id) != keys.end())
{
kp = keys[id];
@@ -440,11 +468,13 @@
vector all_privkeys;
app.keys.get_keys(all_privkeys);
- N(!all_privkeys.empty(), F("you have no private key to make signatures with\n"
- "perhaps you need to 'genkey '"));
+ N(!all_privkeys.empty(),
+ F("you have no private key to make signatures with\n"
+ "perhaps you need to 'genkey '"));
N(all_privkeys.size() == 1,
F("you have multiple private keys\n"
- "pick one to use for signatures by adding '-k' to your command"));
+ "pick one to use for signatures "
+ "by adding '-k' to your command"));
key = all_privkeys[0];
}
@@ -453,7 +483,8 @@
app_state & app,
cert_value & branchname)
{
- if ((app.branch_name() != "") && app.is_explicit_option(OPT_BRANCH_NAME))
+ if ((app.branch_name() != "")
+ && app.is_explicit_option(OPT_BRANCH_NAME))
{
branchname = app.branch_name();
}
@@ -499,10 +530,10 @@
static void
put_simple_revision_cert(revision_id const & id,
- cert_name const & nm,
- cert_value const & val,
- app_state & app,
- packet_consumer & pc)
+ cert_name const & nm,
+ cert_value const & val,
+ app_state & app,
+ packet_consumer & pc)
{
cert t;
make_simple_cert(id.inner(), nm, val, app, t);
@@ -512,12 +543,12 @@
void
cert_revision_in_branch(revision_id const & rev,
- cert_value const & branchname,
- app_state & app,
- packet_consumer & pc)
+ cert_value const & branchname,
+ app_state & app,
+ packet_consumer & pc)
{
put_simple_revision_cert (rev, branch_cert_name,
- branchname, app, pc);
+ branchname, app, pc);
}
void
@@ -564,26 +595,31 @@
put_simple_revision_cert(m, date_cert_name, val, app, pc);
}
+
void
cert_revision_date_time(revision_id const & m,
time_t t,
app_state & app,
packet_consumer & pc)
{
- // make sure you do all your CVS conversions by 2038!
- boost::posix_time::ptime tmp(boost::gregorian::date(1970,1,1),
- boost::posix_time::seconds(static_cast(t)));
+ // Make sure you do all your CVS conversions by 2038!
+ boost::posix_time::ptime
+ tmp(boost::gregorian::date(1970,1,1),
+ boost::posix_time::seconds(static_cast(t)));
cert_revision_date_time(m, tmp, app, pc);
}
+
void
cert_revision_date_now(revision_id const & m,
app_state & app,
packet_consumer & pc)
{
- cert_revision_date_time(m, boost::posix_time::second_clock::universal_time(), app, pc);
+ cert_revision_date_time
+ (m, boost::posix_time::second_clock::universal_time(), app, pc);
}
+
void
cert_revision_author(revision_id const & m,
string const & author,
@@ -594,6 +630,7 @@
author, app, pc);
}
+
void
cert_revision_author_default(revision_id const & m,
app_state & app,
@@ -604,11 +641,12 @@
{
rsa_keypair_id key;
get_user_key(key, app),
- author = key();
+ author = key();
}
cert_revision_author(m, author, app, pc);
}
+
void
cert_revision_tag(revision_id const & m,
string const & tagname,
@@ -630,6 +668,7 @@
changelog, app, pc);
}
+
void
cert_revision_comment(revision_id const & m,
string const & comment,
@@ -640,6 +679,7 @@
comment, app, pc);
}
+
void
cert_revision_testresult(revision_id const & r,
string const & results,
@@ -658,9 +698,12 @@
results == "0")
passed = false;
else
- throw informative_failure("could not interpret test results, tried '0/1' 'yes/no', 'true/false', 'pass/fail'");
+ throw informative_failure("could not interpret test results, "
+ "tried '0/1' 'yes/no', 'true/false', "
+ "'pass/fail'");
- put_simple_revision_cert(r, testresult_cert_name, lexical_cast(passed), app, pc);
+ put_simple_revision_cert(r, testresult_cert_name,
+ lexical_cast(passed), app, pc);
}
@@ -668,3 +711,11 @@
#include "unit_tests.hh"
#endif // BUILD_UNIT_TESTS
+
+// Local Variables:
+// mode: C++
+// fill-column: 76
+// c-file-style: "gnu"
+// indent-tabs-mode: nil
+// End:
+// vim: et:sw=2:sts=2:ts=2:cino=>2s,{s,\:s,+s,t0,g0,^-2,e-2,n-2,p2s,(0,=s:
============================================================
--- cert.hh 6ccf880b677340a2460ced453c93700b7bae07b3
+++ cert.hh 7fd1b8cafa9903cfb85096c35eb3c3fc81a27950
@@ -1,27 +1,30 @@
#ifndef __CERT_HH__
#define __CERT_HH__
-// copyright (C) 2002, 2003 graydon hoare
-// all rights reserved.
-// licensed to the public under the terms of the GNU GPL (>= 2)
-// see the file COPYING for details
+// Copyright (C) 2002 Graydon Hoare
+//
+// This program is made available under the GNU GPL version 2.0 or
+// greater. See the accompanying file COPYING for details.
+//
+// This program is distributed WITHOUT ANY WARRANTY; without even the
+// implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE.
-#include "vocab.hh"
-
+#include