Jump to content

Query Logic (cm find) for Attributes Help


rtansey96

Recommended Posts

In order to filter out branches that have been merged and/or abandoned (like test branches), I was looking into attributes as they seemed like the easiest way to have a blanket identifier for this kind of flag.

I am able to easily add a "find branches where attribute='Closed' " to find the closed branches, but how can I do the inverse of this? I would like to have a filter that shows everything with an attribute != 'Closed".

I know I could add an attribute to everything, mark it as "1" and set "0" as the "hide" options, but that requires every branch to be updated and modified. Only on finished code reviews should an attribute be appended in order to keep the workflow easy.

Does anyone have any knowledge about Query statement logic and syntax? The documentation only shows "=" examples. Thank you!

Link to comment
Share on other sites

Hi rtansey96,

I think your issue can be solved using the 'not' keyword. If you'd like to list all branches that don't have the 'Closed' attribute set (no matter what value), you can run:

cm find branches where not attribute = 'Closed'

The 'not' operand can be applied to any operation or statement inside the find query.

Is this what you were looking for? :)

 

Regards,

Miguel

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...