rtansey96 Posted September 26, 2017 Report Share Posted September 26, 2017 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 More sharing options...
rtansey96 Posted September 26, 2017 Author Report Share Posted September 26, 2017 Also, if != does exist, but doesn't show branches because they simply don't have one assigned at all, is there a way to check if a branch has no attribute? Link to comment Share on other sites More sharing options...
mig Posted September 27, 2017 Report Share Posted September 27, 2017 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 More sharing options...
rtansey96 Posted September 27, 2017 Author Report Share Posted September 27, 2017 Yes! Thank you very much. This works like a charm. Is there any sort of documentation regarding these Querys? I'm unfamiliar if it is something Plastic has made in-house or if it something already out there. The only documentation I found on the website had few examples, but wasn't very robust. @mig Link to comment Share on other sites More sharing options...
mig Posted September 28, 2017 Report Share Posted September 28, 2017 Glad to hear that! Currently the find documentation can be found here: https://www.plasticscm.com/documentation/cmfind/plastic-scm-version-control-query-system-guide.shtml I'll notify the team to cover all available operands! Thanks for your feedback Regards, Miguel Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.