[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing state of PR's
From: |
Chad Walstrom |
Subject: |
Re: Changing state of PR's |
Date: |
Tue, 26 Sep 2006 16:16:32 -0500 |
> In our gnats there are many PRs at fixed state for quite some
> time. I want to mark all of them as closed at certain
> categories. Is there an easy way to do that?
Yes. You can do this with a shell script using query-pr and pr-edit.
You can specify the query format to only output PR ID's based on the
criteria you set. i.e. "fixed" and in the category "foo". Then
iterate over each one with PR edit.
--------------8<--------------
#!/bin/sh
GNATSDB=server:port:databasename:username:password
export GNATSDB
# collect problem reports
/usr/bin/query-pr --format='"%d" Number' \
--expr='Category=="foo" & State[type] == "fixed"' | \
(while read PR ; do
echo "closed" | \
/usr/lib/gnats/pr-edit --replace=State \
--reason="
Closed in a bulk operation for Release X.Y.Z.
See ChangeLog for details.
" $PR
done)
--------------8<--------------
--
Chad Walstrom <address@hidden> http://www.wookimus.net/
assert(expired(knowledge)); /* core dump */