1 | #␊ |
2 | # old_revision [d8a2add47319b83ac7657d34df8f69c028b61208]␊ |
3 | #␊ |
4 | # add_dir "tests/update_-b_searches_all_heads_if_no_descendant"␊ |
5 | # ␊ |
6 | # add_file "tests/update_-b_searches_all_heads_if_no_descendant/__driver__.lua"␊ |
7 | # content [9a269ad57cf72ae502294737ea0989b1c41ba37e]␊ |
8 | # ␊ |
9 | # patch "cmd_merging.cc"␊ |
10 | # from [97b6b695edfc97d361f655be497353a716976f54]␊ |
11 | # to [7c73fe6b5afd55700a82bf5b988613f8ceac182e]␊ |
12 | #␊ |
13 | ============================================================␊ |
14 | --- tests/update_-b_searches_all_heads_if_no_descendant/__driver__.lua␉9a269ad57cf72ae502294737ea0989b1c41ba37e␊ |
15 | +++ tests/update_-b_searches_all_heads_if_no_descendant/__driver__.lua␉9a269ad57cf72ae502294737ea0989b1c41ba37e␊ |
16 | @@ -0,0 +1,17 @@␊ |
17 | +mtn_setup()␊ |
18 | +␊ |
19 | +addfile("a", "a")␊ |
20 | +commit("foo")␊ |
21 | +␊ |
22 | +addfile("b", "b")␊ |
23 | +commit("foo.subbranch")␊ |
24 | +␊ |
25 | +check(mtn("version"), 0, false, false)␊ |
26 | +␊ |
27 | +-- according to https://savannah.nongnu.org/bugs/?29835␊ |
28 | +-- this fails␊ |
29 | +check(mtn("update", "-b", "foo"), 0, false, false)␊ |
30 | +␊ |
31 | +-- and this not ␊ |
32 | +-- check(mtn("update", "-rh:foo"), 0, false, false)␊ |
33 | +-- they should be the same as "newbranch" is children from "testbranch"␊ |
34 | ============================================================␊ |
35 | --- cmd_merging.cc␉97b6b695edfc97d361f655be497353a716976f54␊ |
36 | +++ cmd_merging.cc␉7c73fe6b5afd55700a82bf5b988613f8ceac182e␊ |
37 | @@ -206,11 +206,14 @@ update(app_state & app,␊ |
38 | pick_update_candidates(app.lua, project, candidates, old_rid,␊ |
39 | app.opts.branch,␊ |
40 | app.opts.ignore_suspend_certs);␊ |
41 | - E(!candidates.empty(), origin::user,␊ |
42 | - F("your request matches no descendents of the current revision\n"␊ |
43 | - "in fact, it doesn't even match the current revision\n"␊ |
44 | - "maybe you want something like --revision=h:%s")␊ |
45 | - % app.opts.branch);␊ |
46 | + if (candidates.empty())␊ |
47 | + {␊ |
48 | + W(F("your request matches no descendents of the current revision\n"␊ |
49 | + "in fact, it doesn't even match the current revision"));␊ |
50 | + P(F("searching for all heads of branch '%s'") % app.opts.branch);␊ |
51 | + ␊ |
52 | + project.db.select_cert(branch_cert_name(), app.opts.branch(), candidates);␊ |
53 | + }␊ |
54 | if (candidates.size() != 1)␊ |
55 | {␊ |
56 | P(F("multiple update candidates:"));␊ |