Re: Changing state of PR's
Chad Walstrom <[email protected]> Tue, 26 Sep 2006 16:16:32 -0500
| Newsgroups | gmane.comp.bug-tracking.gnats.general |
|---|---|
| Message-ID | <[email protected]> |
> 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 <[email protected]> http://www.wookimus.net/
assert(expired(knowledge)); /* core dump */