# # # patch "monotone.texi" # from [1d3a15d2ba9a607fd8fc6923e2de670c0a2dbffc] # to [7aaea7a1094c1291d77ae5aa0d1f5ac25b1d4620] # # patch "selectors.cc" # from [0f13a8cddbbf86ad067e16e2ca3fec2812b3f3bc] # to [c9398d4afe1fa2b32571548f786c7055f0801569] # # patch "tests/extended-selectors/__driver__.lua" # from [4eef27537290df61cc1c5d76cadb0f5a433abca7] # to [d5ed878a048a1966b23fa5e7413244ac785efd8f] # ============================================================ --- monotone.texi 1d3a15d2ba9a607fd8fc6923e2de670c0a2dbffc +++ monotone.texi 7aaea7a1094c1291d77ae5aa0d1f5ac25b1d4620 @@ -2879,9 +2879,9 @@ @heading Composite selectors @heading Composite selectors Selectors may be combined with @code{and} and @code{or} operators and -parentheses, and may be modified using a syntax similar to C function calls. -The recognized special characters are @code{/}, @code{|}, @code{,}, @code{(} -and @code{)}, and @code{\} (forward slash, pipe, comma, left and right +parentheses, and may be modified using a function-call style syntax. +The recognized special characters are @code{/}, @code{|}, @code{;}, @code{(} +and @code{)}, and @code{\} (forward slash, pipe, semicolon, left and right parentheses, and backslash); to use any of these characters in a selector value, precede it with a backslash (@code{\}). @@ -2895,18 +2895,20 @@ @heading Composite selectors heads of two specific branches. There are also several selector functions defined, which take one or more -selectors as arguments. These are: +selectors as arguments. The general form for these is address@hidden '(' selector [ ';' selector ... ] ')'}, that is, arguments are +enclosed in parantheses and separated by semicolons. These are: @table @code address@hidden difference(A,B) address@hidden difference(A;B) Set difference; this returns all revisions selected by A but not by B. For -example, @code{difference(a:graydon,b:net.venge.monotone)} would return all +example, @code{difference(a:graydon;b:net.venge.monotone)} would return all revisions which have an @code{author} cert beginning with @code{graydon} which are not in the branch @code{net.venge.monotone}. address@hidden lca(A,B) address@hidden lca(A;B) Least common ancestors; this is identical to @code{max((ancestors(A)|A)/(ancestors(B)|B))}, but it may be faster and is certainly more convenient to type. For example, address@hidden(h:net.venge.monotone,h:net.venge.monotone.extended-selectors)} would address@hidden(h:net.venge.monotone;h:net.venge.monotone.extended-selectors)} would return the last propagate between the given branches, or the branch point if there were no subsequent propagates yet. This could be particularly useful with the @code{diff} command, to see exactly what has changed on a given branch. ============================================================ --- selectors.cc 0f13a8cddbbf86ad067e16e2ca3fec2812b3f3bc +++ selectors.cc c9398d4afe1fa2b32571548f786c7055f0801569 @@ -647,7 +647,7 @@ shared_ptr selector::create(op // Using bisonc++ with flex in c++ mode might be better, except that // bisonc++ is GPLv3 *without* (as far as I can see) an exception for use // of the parser skeleton as included in the output. - string const special_chars("(),\\/|"); + string const special_chars("();\\/|"); boost::char_separator splitter("", special_chars.c_str()); typedef boost::tokenizer > tokenizer_t; tokenizer_t tokenizer(orig, splitter); @@ -728,7 +728,7 @@ shared_ptr selector::create(op { L(FL(" found argument at stack position %d") % i); shared_ptr arg = idx(items,i).sel; - E(i == items.size() - 1 || idx(items,i+1).str == ",", origin::user, + E(i == items.size() - 1 || idx(items,i+1).str == ";", origin::user, F("selector '%s' is invalid, function argument doesn't look like an arg-list")); to_add->add(arg); } @@ -747,7 +747,7 @@ shared_ptr selector::create(op items.pop_back(); items.push_back(parse_item(to_add)); } - } else if (*tok == ",") { + } else if (*tok == ";") { items.push_back(parse_item(*tok)); } else if (*tok == "/") { E(!items.empty(), origin::user, ============================================================ --- tests/extended-selectors/__driver__.lua 4eef27537290df61cc1c5d76cadb0f5a433abca7 +++ tests/extended-selectors/__driver__.lua d5ed878a048a1966b23fa5e7413244ac785efd8f @@ -78,15 +78,15 @@ expect("b:testbranch|b:otherbranch", roo expect("b:testbranch/b:otherbranch", lhs) expect("b:testbranch|b:otherbranch", root, lhs, rhs, m, other, other_2) -expect("lca(h:testbranch,h:otherbranch)", lhs) +expect("lca(h:testbranch;h:otherbranch)", lhs) expect("max(b:testbranch/a:Joe)", lhs) expect("max(b:otherbranch/a:Anne)") -expect("difference(b:testbranch,a:Joe)", rhs, m) +expect("difference(b:testbranch;a:Joe)", rhs, m) expect("ancestors(b:otherbranch)", other, lhs, root) expect("descendants("..lhs..")", m, other, other_2) -expect("parents(lca(h:otherbranch,h:testbranch))", root) -expect("children(lca(h:otherbranch,h:testbranch))", m, other) +expect("parents(lca(h:otherbranch;h:testbranch))", root) +expect("children(lca(h:otherbranch;h:testbranch))", m, other) other_head = merge(other_2, m, "otherbranch", "Jack") expect("max((ancestors(h:testbranch)|h:testbranch)/(ancestors(h:otherbranch)|h:otherbranch))", m) -expect("lca(h:testbranch,h:otherbranch)", m) +expect("lca(h:testbranch;h:otherbranch)", m)