# # # patch "cmd_policy.cc" # from [6bcb61826311a778e7e4c04b263dc1912886c128] # to [a28b3fb83a3e2393ce0e4043f86c2e3233a553a2] # # patch "policies/delegation.cc" # from [39fcae010fdb237b9691223cfcefc35f21d132ad] # to [4b23ad3d399c881870a36c4fe6ee124b1d8cadb1] # # patch "policies/policy_branch.cc" # from [77a6f8d73186af27ba934387c043cdd189f448dc] # to [740286a7466517294d7660f19e089957ef80d661] # ============================================================ --- cmd_policy.cc 6bcb61826311a778e7e4c04b263dc1912886c128 +++ cmd_policy.cc a28b3fb83a3e2393ce0e4043f86c2e3233a553a2 @@ -120,7 +120,8 @@ CMD(create_subpolicy, "create_subpolicy" parent.set_delegation(del_name(), policies::delegation::create(app, admin_keys)); parent_branch.commit(project, keys, parent, - utf8("Add delegation to new child policy")); + utf8("Add delegation to new child policy"), + parent_branch.begin()); } CMD(create_branch, "create_branch", "", CMD_REF(policy), @@ -163,7 +164,8 @@ CMD(create_branch, "create_branch", "", suffix = branch_name("__main__", origin::internal); ppol.set_branch(suffix(), policies::branch::create(app, admin_keys)); parent.commit(project, keys, ppol, - utf8("Add branch.")); + utf8("Add branch."), + parent.begin()); } CMD_FWD_DECL(list); ============================================================ --- policies/delegation.cc 39fcae010fdb237b9691223cfcefc35f21d132ad +++ policies/delegation.cc 4b23ad3d399c881870a36c4fe6ee124b1d8cadb1 @@ -102,6 +102,11 @@ namespace policies { { W(F("Policy branch '%s' has %d heads; need 1 head") % branch_desc.get_uid() % br.size()); + for (policy_branch::iterator i = br.begin(); + i != br.end(); ++i) + { + W(F("Heads are: '%s'") % i->first); + } return boost::shared_ptr(); } return br.begin()->second; ============================================================ --- policies/policy_branch.cc 77a6f8d73186af27ba934387c043cdd189f448dc +++ policies/policy_branch.cc 740286a7466517294d7660f19e089957ef80d661 @@ -275,7 +275,9 @@ namespace policies { roster_t new_roster; if (parents.empty()) { - + // prevent creation of extra heads + I(begin() == end()); + parents.insert(make_pair(revision_id(), make_pair(roster_t_cp(new roster_t()), marking_map_cp(new marking_map()))));