# # # patch "cmd_key_cert.cc" # from [b23e6f14a128e50502210fe6f0d4f270fc526a8e] # to [72cff83da3a4754820db75fbe9b86176e937b331] # # patch "cmd_policy.cc" # from [e3e698c544f61dc2ab58549e7264c0d896d56f29] # to [9aaf990cedfd5765aea57d0105b680a287d767ac] # # patch "project.cc" # from [c4fd952781f6b3a2203a842f239e408bab394f9e] # to [30eceeb9fc7019117418ebcf28505a103196c5bc] # # patch "project.hh" # from [c20d9905b9dae288c4db7641ba9b122df6a24260] # to [ff88cd736651c2a719fd9bd077a31baa136b0cd8] # ============================================================ --- cmd_key_cert.cc b23e6f14a128e50502210fe6f0d4f270fc526a8e +++ cmd_key_cert.cc 72cff83da3a4754820db75fbe9b86176e937b331 @@ -276,7 +276,7 @@ CMD(tag, "tag", "", CMD_REF(review), N_( complete(app, idx(args, 0)(), r); cache_user_key(app.opts, app.lua, app.keys, app.db); - app.get_project().put_tag(app.keys, r, idx(args, 1)()); + app.projects.put_tag(app.keys, r, idx(args, 1)()); } @@ -332,7 +332,6 @@ CMD(suspend, "suspend", "", CMD_REF(revi app.projects .get_project_of_branch(app.opts.branchname) .suspend_revision_in_branch(app.keys, r, app.opts.branchname); - app.opts.branchname); } CMD(comment, "comment", "", CMD_REF(review), N_("REVISION [COMMENT]"), ============================================================ --- cmd_policy.cc e3e698c544f61dc2ab58549e7264c0d896d56f29 +++ cmd_policy.cc 9aaf990cedfd5765aea57d0105b680a287d767ac @@ -10,6 +10,7 @@ #include "cmd.hh" #include "dates.hh" #include "file_io.hh" +#include "keys.hh" #include "revision.hh" #include "roster.hh" #include "transforms.hh" @@ -73,8 +74,7 @@ namespace { std::set const & administrators, std::string & policy_uid, data & spec) { - rsa_keypair_id key; - get_user_key(key, keys, db); + cache_user_key(opts, lua, keys, db); policy_uid = generate_uid(); transaction_guard guard(db); @@ -121,8 +121,8 @@ namespace { if (author.empty()) { if (!lua.hook_get_author(branch_name(policy_name() + ".__policy__"), - key, author)) - author = key(); + keys.signing_key, author)) + author = keys.signing_key(); } utf8 changelog(N_("Create new policy branch.")); @@ -156,10 +156,9 @@ CMD(create_project, "create_project", "" F("You already have a project with that name.")); mkdir_p(project_dir); - rsa_keypair_id key; - get_user_key(key, app.keys, app.db); + cache_user_key(app.opts, app.lua, app.keys, app.db); std::set admin_keys; - admin_keys.insert(key); + admin_keys.insert(app.keys.signing_key); std::string policy_uid; data policy_spec; ============================================================ --- project.cc c4fd952781f6b3a2203a842f239e408bab394f9e +++ project.cc 30eceeb9fc7019117418ebcf28505a103196c5bc @@ -949,6 +949,14 @@ project_set::get_tags(std::set & return projects.begin()->second.get_tags(tags); } +void +project_set::put_tag(key_store & keys, + revision_id const & id, + string const & name) +{ + cert_revision_tag(id, name, db, keys); +} + outdated_indicator project_set::get_revision_branches(revision_id const & id, std::set & branches) ============================================================ --- project.hh c20d9905b9dae288c4db7641ba9b122df6a24260 +++ project.hh ff88cd736651c2a719fd9bd077a31baa136b0cd8 @@ -154,6 +154,8 @@ public: // What tags exist across all projects? outdated_indicator get_tags(std::set & tags); + // Because tags aren't yet per-project. + void put_tag(key_store & keys, revision_id const & id, std::string const & name); // What branches in *any* project does the given revision belong to? outdated_indicator get_revision_branches(revision_id const & id,