cidico Posted February 16, 2012 Report Share Posted February 16, 2012 Hi, I'm starting using attributes and I wanted to create a custom query to list all branches that were created more than 2 days ago. I'm trying to enforce the 16 hours scrum policy inside plastic to see and force my co-workers to not use the same branch for 2 weeks... There are some people that have problems understanding the branch-per-task here.. :/ How can I do that? I've tried things like: find branch where (date - getdate()) > 2 and (attribute='Status' and attrvalue='Em Andamento') find branch where (date - now) > 2 and (attribute='Status' and attrvalue='Em Andamento') find branch where (date - today) > 2 and (attribute='Status' and attrvalue='Em Andamento') find branch where (date - DateTime.Now) > 2 and (attribute='Status' and attrvalue='Em Andamento') but all those ends in errors. Is possible to do that? Thanks in advance! Link to comment Share on other sites More sharing options...
manu Posted February 21, 2012 Report Share Posted February 21, 2012 Hi cidico, maybe you can use something like this: cm find branch where date > '22/01/2012' and date < '25/01/2012' and attrvalue='FAILED' You don't need to write the "attribute='Status'" part, I know, it's quite strange... Link to comment Share on other sites More sharing options...
cidico Posted February 21, 2012 Author Report Share Posted February 21, 2012 Hi manu, Nice to see you're back from Korea! The problem is I wanted to get the query more "generic"... To use forever and ever, always finding the branch that has more than 2 days. Can it be done? Link to comment Share on other sites More sharing options...
manu Posted February 21, 2012 Report Share Posted February 21, 2012 Thanks cidico! I'm happy to be back in Spain! mmmmm I think you need something more elaborated.... due to the branch date is the creation date, not the last used date... What about, for example, create a after-ci trigger that checks if the branch date Vs. the new cset date is greater than 2 days? If it's greater you can make the trigger send you an email regarding the alarm, or you can simple write the notification into a log file for you.... Of course you can also do an external program to check this condition, you will need to code this: * Get all your branches * For each branch ** Get the head cset: cm find branch where name='scm10776' --format={changeset} ** Get the head cset date. ** Get the branch creation date. ** If the distance between the 2 changesets is greater than 2 days -> Alarm Link to comment Share on other sites More sharing options...
ulanda Posted February 23, 2012 Report Share Posted February 23, 2012 I want to request a blog post about the query options, I have seen "newer that 10 days" querys that are much more convenient than the date based ones, and I can bet there are much more goodies hidden there Also for the date filter in branch explorer would be much more useful with this query, as you most of the times want to see only the most recent branches, don't lose the range based view as its useful for the statistics view, but please ad the recent filter as default Link to comment Share on other sites More sharing options...
psantosl Posted February 23, 2012 Report Share Posted February 23, 2012 And your dreams come true: http://codicesoftware.blogspot.com/2012/02/definitive-guide-to-find.html Link to comment Share on other sites More sharing options...
ulanda Posted February 24, 2012 Report Share Posted February 24, 2012 Thanks Pablo! ktgw Unai Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.