# # # add_dir "tests/netsync_with_suspended_branch" # # add_file "tests/netsync_with_suspended_branch/__driver__.lua" # content [3fde78d6b9affcfe2c777f518c04b3e36292d14a] # # patch "netsync.cc" # from [cc9d975f07205728cb9910ca66f958892fcc856b] # to [08f811440a008298f385e7d0cbd907e60c1421d3] # # patch "project.cc" # from [bc5f626244e7e3de2cd2e5b6bee4832201c52570] # to [827a27cad0a963b5359d793837dfa094cc468866] # # patch "project.hh" # from [006890147145473431c3da49d6883ea10cd4c200] # to [985ba278a0a308bf439c99489bbcec8cec121249] # ============================================================ --- tests/netsync_with_suspended_branch/__driver__.lua 3fde78d6b9affcfe2c777f518c04b3e36292d14a +++ tests/netsync_with_suspended_branch/__driver__.lua 3fde78d6b9affcfe2c777f518c04b3e36292d14a @@ -0,0 +1,18 @@ + +include("/common/netsync.lua") +mtn_setup() +netsync.setup() + +addfile("testfile", "blah stuff") +commit() +ver0 = base_revision() + +addfile("testfile2", "some more data") +commit("otherbranch") +ver1 = base_revision() +check(mtn("suspend", "-b", "otherbranch", ver1), 0, false, false) + +netsync.pull("*") + +check_same_stdout(mtn("ls", "certs", ver1), + mtn2("ls", "certs", ver1)) ============================================================ --- netsync.cc cc9d975f07205728cb9910ca66f958892fcc856b +++ netsync.cc 08f811440a008298f385e7d0cbd907e60c1421d3 @@ -1333,7 +1333,7 @@ session::process_hello_cmd(rsa_keypair_i // clients always include in the synchronization set, every branch that the // user requested set all_branches, ok_branches; - app.get_project().get_branch_list(all_branches); + app.get_project().get_branch_list(all_branches, false); for (set::const_iterator i = all_branches.begin(); i != all_branches.end(); i++) { @@ -1427,7 +1427,7 @@ session::process_anonymous_cmd(protocol_ } set all_branches, ok_branches; - app.get_project().get_branch_list(all_branches); + app.get_project().get_branch_list(all_branches, false); globish_matcher their_matcher(their_include_pattern, their_exclude_pattern); for (set::const_iterator i = all_branches.begin(); i != all_branches.end(); i++) @@ -1560,7 +1560,7 @@ session::process_auth_cmd(protocol_role } set all_branches, ok_branches; - app.get_project().get_branch_list(all_branches); + app.get_project().get_branch_list(all_branches, false); for (set::const_iterator i = all_branches.begin(); i != all_branches.end(); i++) { ============================================================ --- project.cc bc5f626244e7e3de2cd2e5b6bee4832201c52570 +++ project.cc 827a27cad0a963b5359d793837dfa094cc468866 @@ -21,7 +21,7 @@ void {} void -project_t::get_branch_list(std::set & names) +project_t::get_branch_list(std::set & names, bool allow_suspend_certs) { if (indicator.outdated()) { @@ -37,9 +37,10 @@ project_t::get_branch_list(std::set heads; - get_branch_heads(branch, heads, &inverse_graph_cache); + if (allow_suspend_certs) + get_branch_heads(branch, heads, &inverse_graph_cache); - if (!heads.empty()) + if (!allow_suspend_certs || !heads.empty()) branches.insert(branch); } } @@ -49,7 +50,8 @@ project_t::get_branch_list(globish const void project_t::get_branch_list(globish const & glob, - std::set & names) + std::set & names, + bool allow_suspend_certs) { std::vector got; app.db.get_branches(glob(), got); @@ -63,9 +65,10 @@ project_t::get_branch_list(globish const const branch_name branch(*i); std::set heads; - get_branch_heads(branch, heads, &inverse_graph_cache); + if (allow_suspend_certs) + get_branch_heads(branch, heads, &inverse_graph_cache); - if (!heads.empty()) + if (!allow_suspend_certs || !heads.empty()) names.insert(branch); } } ============================================================ --- project.hh 006890147145473431c3da49d6883ea10cd4c200 +++ project.hh 985ba278a0a308bf439c99489bbcec8cec121249 @@ -33,8 +33,9 @@ public: public: project_t(app_state & app); - void get_branch_list(std::set & names); - void get_branch_list(globish const & glob, std::set & names); + void get_branch_list(std::set & names, bool allow_suspend_certs = true); + void get_branch_list(globish const & glob, std::set & names, + bool allow_suspend_certs = true); void get_branch_heads(branch_name const & name, std::set & heads, std::multimap *inverse_graph_cache_ptr = NULL);