Jump to content

Queries a little bit more complex than normal


cidico

Recommended Posts

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... :P

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

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

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

Archived

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

×
×
  • Create New...