# # # patch "cert.cc" # from [d2afa981ee74ad4d5ae61a86509aeef6845f9882] # to [fbb19321180a184c2cf5c3304f5c96c7b04dfa07] # # patch "cert.hh" # from [c4f0ca48886f7fef9c4933733afd3d7db1ba4904] # to [cc43347fcae9fb7630dce8236959f6612496be49] # # patch "project.cc" # from [3a88d948dad77b6339c41972a0215ee7df52758e] # to [461b8ce128b56b455062451cb08119b9a0d6a748] # ============================================================ --- cert.cc d2afa981ee74ad4d5ae61a86509aeef6845f9882 +++ cert.cc fbb19321180a184c2cf5c3304f5c96c7b04dfa07 @@ -513,7 +513,7 @@ cert_revision_in_branch(revision_id cons void cert_revision_in_branch(revision_id const & rev, - branch_name const & branch, + branch_uid const & branch, database & db, key_store & keys) { @@ -523,7 +523,7 @@ cert_revision_suspended_in_branch(revisi void cert_revision_suspended_in_branch(revision_id const & rev, - branch_name const & branch, + branch_uid const & branch, database & db, key_store & keys) { ============================================================ --- cert.hh c4f0ca48886f7fef9c4933733afd3d7db1ba4904 +++ cert.hh cc43347fcae9fb7630dce8236959f6612496be49 @@ -108,7 +108,7 @@ cert_revision_in_branch(revision_id cons void cert_revision_in_branch(revision_id const & ctx, - branch_name const & branchname, + branch_uid const & branch, database & db, key_store & keys); @@ -136,7 +136,7 @@ cert_revision_suspended_in_branch(revisi void cert_revision_suspended_in_branch(revision_id const & ctx, - branch_name const & branchname, + branch_uid const & branch, database & db, key_store & keys); void ============================================================ --- project.cc 3a88d948dad77b6339c41972a0215ee7df52758e +++ project.cc 461b8ce128b56b455062451cb08119b9a0d6a748 @@ -544,8 +544,13 @@ project_t::revision_is_in_branch(revisio project_t::revision_is_in_branch(revision_id const & id, branch_name const & branch) { + branch_uid bid; + if (project_policy->passthru) + bid = branch_uid(branch()); + else + bid = translate_branch(branch); base64 branch_encoded; - encode_base64(cert_value(branch()), branch_encoded); + encode_base64(cert_value(bid()), branch_encoded); vector > certs; db.get_revision_certs(id, branch_cert_name, branch_encoded, certs); @@ -568,15 +573,25 @@ project_t::put_revision_in_branch(key_st revision_id const & id, branch_name const & branch) { - cert_revision_in_branch(id, branch, db, keys); + branch_uid bid; + if (project_policy->passthru) + bid = branch_uid(branch()); + else + bid = translate_branch(branch); + cert_revision_in_branch(id, bid, db, keys); } bool project_t::revision_is_suspended_in_branch(revision_id const & id, branch_name const & branch) { + branch_uid bid; + if (project_policy->passthru) + bid = branch_uid(branch()); + else + bid = translate_branch(branch); base64 branch_encoded; - encode_base64(cert_value(branch()), branch_encoded); + encode_base64(cert_value(bid()), branch_encoded); vector > certs; db.get_revision_certs(id, suspend_cert_name, branch_encoded, certs); @@ -599,7 +614,12 @@ project_t::suspend_revision_in_branch(ke revision_id const & id, branch_name const & branch) { - cert_revision_suspended_in_branch(id, branch, db, keys); + branch_uid bid; + if (project_policy->passthru) + bid = branch_uid(branch()); + else + bid = translate_branch(branch); + cert_revision_suspended_in_branch(id, bid, db, keys); } @@ -639,7 +659,17 @@ project_t::get_revision_branches(revisio { cert_value b; decode_base64(i->inner().value, b); - branches.insert(branch_name(b())); + if (project_policy->passthru) + branches.insert(branch_name(b())); + else + { + std::set branchids; + get_branch_list(branchids); + if (branchids.find(branch_uid(b())) != branchids.end()) + branches.insert(translate_branch(branch_uid(b()))); + else + branches.insert(branch_name(b())); + } } return i; } @@ -648,8 +678,13 @@ project_t::get_branch_certs(branch_name project_t::get_branch_certs(branch_name const & branch, std::vector > & certs) { + branch_uid bid; + if (project_policy->passthru) + bid = branch_uid(branch()); + else + bid = translate_branch(branch); base64 branch_encoded; - encode_base64(cert_value(branch()), branch_encoded); + encode_base64(cert_value(bid()), branch_encoded); return db.get_revision_certs(branch_cert_name, branch_encoded, certs); } @@ -712,7 +747,12 @@ project_t::put_standard_certs(key_store date_t const & time, utf8 const & author) { - cert_revision_in_branch(id, branch, db, keys); + branch_uid bid; + if (project_policy->passthru) + bid = branch_uid(branch()); + else + bid = translate_branch(branch); + cert_revision_in_branch(id, bid, db, keys); cert_revision_changelog(id, changelog, db, keys); cert_revision_date_time(id, time, db, keys); if (!author().empty())