Support for more complex find queries
Specifically, I want to find all changesets with two attributes with specific values. Something like:
find changesets where attribute = 'Review status' is 'none' and attribute = 'Reviewer' is 'somebody'
UPDATE: It's possible to use the following syntax to check for an attribute-value, regardless of which attribute has that value:
where attrvalue = 'some_name'
It's also possible to combine these with OR to match one of several values:
where attrvalue = 'some_name' or attrvalue = 'other_name'
However, combining these with AND does not work to match two different values of two different attributes.
Also, the following works as expected (note the use of OR between parantheses) :
where (attribute = 'attr1' and attrvalue = 'some_name') or (attribute = 'attr2' and attrvalue = 'other_name')
However, the following does not work as one would want (note the use of AND between parantheses) :
where (attribute = 'attr1' and attrvalue = 'some_name') and (attribute = 'attr2' and attrvalue = 'other_name')
The exact syntax and limitations of the cm find command remains a mystery... It is not very consistent, unfortunately.
I added the request for branch depth/level support in "find branch" as a separate uservoice here:
I added the request for branch namespace support in "find branch" as a separate uservoice here:
Please vote for it if you care about this...
UPDATE: The following command actually works (at least in 188.8.131.521) for finding all the branches that do NOT have the specific attribute "branch_status" applied (regardless of whether there are other attributes or not) :
cm find branch where not attribute = 'branch_status'
(Note the use of "not" instead of "!=" in this query...)
To filter the Branches view for branches that do NOT have a specific attribute for our "branch_status" attribute, I can use the following syntax:
find branch where attribute="branch_status" and attrvalue != "completed"
However, that will NOT include branches that don't have that attribute applied at all. It would be much more useful if there was a way to include these too in the same query.
To find the branches that don't have the attribute applied, it would be logical to use the following syntax:
find branch where attribute != "branch_status"
That query works, but not as expected. It has a very counter-intuitive interpretation: [where (count attributes > 0) AND (attributes DO NOT CONTAIN 'branch_status')].
Please consider changing the interpretation to simply: [where (attributes DO NOT CONTAIN 'branch_status')].
Additionally, finding a branch by namespace is not possible. Even worse, [find branch where name = 'main'] returns 1 branch, but [find branch where name = '/main'] returns none! Please add full namespace support so we can find branches by complete name such as name = '/main/task001/subtask_1'.
Also, I propose adding a "depth" or "level" filter-option for the branch find-object, to filter on branch namespace-depth (like "Display branch levels" in Branch Explorer).
Yeah. That's what I was asking for here: http://www.plasticscm.net/index.php?/topic/2002-find-changesets-where-a-specific-attribute-is-not-set/?hl=%2Bfind+%2Battribute
Also, a way to find all branches etc where a specific attribute is NOT applied.