diff options
author | W. Trevor King <wking@drexel.edu> | 2008-12-04 12:42:22 -0500 |
---|---|---|
committer | W. Trevor King <wking@drexel.edu> | 2008-12-04 12:42:22 -0500 |
commit | 30d707caba54c452dc33168536c8fa3c33ed47bd (patch) | |
tree | b1bb38c83342d10fcdf0b66bedbdcc1c389bad94 | |
parent | f6c5402f58b8450ee4e1a78da87b560491abbd45 (diff) | |
parent | 72f9263f3d812fb817e0bc4f5c7d07b60df2cd6c (diff) | |
download | bugseverywhere-30d707caba54c452dc33168536c8fa3c33ed47bd.tar.gz |
Merged in the successful per-tree-config branch.
42 files changed, 397 insertions, 325 deletions
diff --git a/.be/bugs/16fc9496-cdc2-4c6e-9b9f-b8f483b6dedb/comments/489397bd-b987-4a08-9589-c5b71661ebb7/body b/.be/bugs/16fc9496-cdc2-4c6e-9b9f-b8f483b6dedb/comments/489397bd-b987-4a08-9589-c5b71661ebb7/body new file mode 100644 index 0000000..6f00ded --- /dev/null +++ b/.be/bugs/16fc9496-cdc2-4c6e-9b9f-b8f483b6dedb/comments/489397bd-b987-4a08-9589-c5b71661ebb7/body @@ -0,0 +1,5 @@ +Aaron said this was closeable in Nov. 24th email to the BE list. + +I think "priorities" == "bug severities", in which case this +functionality is now available with the per-tree severity +configuration. diff --git a/.be/bugs/16fc9496-cdc2-4c6e-9b9f-b8f483b6dedb/comments/489397bd-b987-4a08-9589-c5b71661ebb7/values b/.be/bugs/16fc9496-cdc2-4c6e-9b9f-b8f483b6dedb/comments/489397bd-b987-4a08-9589-c5b71661ebb7/values new file mode 100644 index 0000000..dae549f --- /dev/null +++ b/.be/bugs/16fc9496-cdc2-4c6e-9b9f-b8f483b6dedb/comments/489397bd-b987-4a08-9589-c5b71661ebb7/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Thu, 04 Dec 2008 17:16:11 +0000 + + +From: W. Trevor King <wking@drexel.edu> + diff --git a/.be/bugs/16fc9496-cdc2-4c6e-9b9f-b8f483b6dedb/values b/.be/bugs/16fc9496-cdc2-4c6e-9b9f-b8f483b6dedb/values index 3a5c80c..400c6de 100644 --- a/.be/bugs/16fc9496-cdc2-4c6e-9b9f-b8f483b6dedb/values +++ b/.be/bugs/16fc9496-cdc2-4c6e-9b9f-b8f483b6dedb/values @@ -1,35 +1,14 @@ +creator: abentley +severity: minor -creator=abentley +status: closed +summary: Arbitrary numerical priorities? - -severity=minor - - - - - - -status=open - - - - - - -summary=Arbitrary numerical priorities? - - - - - - -time=Wed, 04 Jan 2006 21:09:30 +0000 - - +time: Wed, 04 Jan 2006 21:09:30 +0000 diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/comments/f21bec0d-cad0-44d2-a301-bfb11adce313/body b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/comments/f21bec0d-cad0-44d2-a301-bfb11adce313/body new file mode 100644 index 0000000..dd40bfa --- /dev/null +++ b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/comments/f21bec0d-cad0-44d2-a301-bfb11adce313/body @@ -0,0 +1 @@ +Aaron said this was closeable in Nov. 24th email to the BE list. diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/comments/f21bec0d-cad0-44d2-a301-bfb11adce313/values b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/comments/f21bec0d-cad0-44d2-a301-bfb11adce313/values new file mode 100644 index 0000000..ad389a7 --- /dev/null +++ b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/comments/f21bec0d-cad0-44d2-a301-bfb11adce313/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Thu, 04 Dec 2008 17:21:08 +0000 + + +From: W. Trevor King <wking@drexel.edu> + diff --git a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/values b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/values index 402cd43..1d358cd 100644 --- a/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/values +++ b/.be/bugs/2aa60b34-2c8d-4f41-bb97-a57309523262/values @@ -1,28 +1,11 @@ +creator: abentley +severity: minor -creator=abentley +status: closed - - - -severity=minor - - - - - - -status=open - - - - - - -summary=implement message-change log - - +summary: implement message-change log diff --git a/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/comments/0d8af004-8352-4254-b747-d96a40a5d457/body b/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/comments/0d8af004-8352-4254-b747-d96a40a5d457/body new file mode 100644 index 0000000..708159c --- /dev/null +++ b/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/comments/0d8af004-8352-4254-b747-d96a40a5d457/body @@ -0,0 +1 @@ +Implemented diff --git a/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/comments/0d8af004-8352-4254-b747-d96a40a5d457/values b/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/comments/0d8af004-8352-4254-b747-d96a40a5d457/values new file mode 100644 index 0000000..6e9546e --- /dev/null +++ b/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/comments/0d8af004-8352-4254-b747-d96a40a5d457/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Thu, 04 Dec 2008 17:40:08 +0000 + + +From: W. Trevor King <wking@drexel.edu> + diff --git a/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/values b/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/values index 9485ae7..8704a7e 100644 --- a/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/values +++ b/.be/bugs/301724b1-3853-4aff-8f23-44373df7cf1c/values @@ -1,35 +1,14 @@ +assigned: abentley +creator: abentley -assigned=abentley +severity: minor +status: fixed - -creator=abentley - - - - - - -severity=minor - - - - - - -status=open - - - - - - -summary=Per-tree configuration: default-assigneed? - - +summary: 'Per-tree configuration: default-assigneed?' diff --git a/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/0ac3c4cb-90e3-4b67-b6cb-1186d5d66240/body b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/0ac3c4cb-90e3-4b67-b6cb-1186d5d66240/body new file mode 100644 index 0000000..ab2dc28 --- /dev/null +++ b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/0ac3c4cb-90e3-4b67-b6cb-1186d5d66240/body @@ -0,0 +1 @@ +Merged into bug ae998b27-a11b-4243-abf6-11841e5b8242
\ No newline at end of file diff --git a/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/0ac3c4cb-90e3-4b67-b6cb-1186d5d66240/values b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/0ac3c4cb-90e3-4b67-b6cb-1186d5d66240/values new file mode 100644 index 0000000..667dc94 --- /dev/null +++ b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/0ac3c4cb-90e3-4b67-b6cb-1186d5d66240/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Thu, 04 Dec 2008 17:05:50 +0000 + + +From: W. Trevor King <wking@drexel.edu> + diff --git a/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/942cd941-583d-4020-99e4-80de7e836129/body b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/942cd941-583d-4020-99e4-80de7e836129/body new file mode 100644 index 0000000..d0b8404 --- /dev/null +++ b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/942cd941-583d-4020-99e4-80de7e836129/body @@ -0,0 +1 @@ +Implemented. diff --git a/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/942cd941-583d-4020-99e4-80de7e836129/values b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/942cd941-583d-4020-99e4-80de7e836129/values new file mode 100644 index 0000000..225f59e --- /dev/null +++ b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/comments/942cd941-583d-4020-99e4-80de7e836129/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Thu, 04 Dec 2008 15:42:07 +0000 + + +From: W. Trevor King <wking@drexel.edu> + diff --git a/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/values b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/values index 5d081cf..37197a7 100644 --- a/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/values +++ b/.be/bugs/4a4609c8-1882-47de-9d30-fee410b8a802/values @@ -1,35 +1,14 @@ +creator: abentley +severity: minor -creator=abentley +status: closed +summary: Do we need a severity between serious and minor? EG "Moderate"? - -severity=serious - - - - - - -status=open - - - - - - -summary=Do we need a severity between serious and minor? EG "Moderate"? - - - - - - -time=Wed, 25 Jan 2006 23:14:07 +0000 - - +time: Wed, 25 Jan 2006 23:14:07 +0000 diff --git a/.be/bugs/68ba7f0c-ca5f-4f49-a508-e39150c07e13/comments/be64734c-d9a8-4f6d-83eb-e9b6c9adc0bf/body b/.be/bugs/68ba7f0c-ca5f-4f49-a508-e39150c07e13/comments/be64734c-d9a8-4f6d-83eb-e9b6c9adc0bf/body new file mode 100644 index 0000000..dd464bf --- /dev/null +++ b/.be/bugs/68ba7f0c-ca5f-4f49-a508-e39150c07e13/comments/be64734c-d9a8-4f6d-83eb-e9b6c9adc0bf/body @@ -0,0 +1,3 @@ +Per-tree severity and target are now supported. + +I'm not sure what Aaron meant be "BE ids". diff --git a/.be/bugs/68ba7f0c-ca5f-4f49-a508-e39150c07e13/comments/be64734c-d9a8-4f6d-83eb-e9b6c9adc0bf/values b/.be/bugs/68ba7f0c-ca5f-4f49-a508-e39150c07e13/comments/be64734c-d9a8-4f6d-83eb-e9b6c9adc0bf/values new file mode 100644 index 0000000..84da235 --- /dev/null +++ b/.be/bugs/68ba7f0c-ca5f-4f49-a508-e39150c07e13/comments/be64734c-d9a8-4f6d-83eb-e9b6c9adc0bf/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Thu, 04 Dec 2008 17:29:30 +0000 + + +From: W. Trevor King <wking@drexel.edu> + diff --git a/.be/bugs/68ba7f0c-ca5f-4f49-a508-e39150c07e13/values b/.be/bugs/68ba7f0c-ca5f-4f49-a508-e39150c07e13/values index a9e974e..b8e8291 100644 --- a/.be/bugs/68ba7f0c-ca5f-4f49-a508-e39150c07e13/values +++ b/.be/bugs/68ba7f0c-ca5f-4f49-a508-e39150c07e13/values @@ -1,28 +1,11 @@ +creator: abentley +severity: wishlist -creator=abentley +status: closed - - - -severity=wishlist - - - - - - -status=open - - - - - - -summary=Support per-tree settings for severity, target, BE ids - - +summary: Support per-tree settings for severity, target, BE ids diff --git a/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/2628eeca-96c6-4933-8484-d55bb1dbf985/body b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/2628eeca-96c6-4933-8484-d55bb1dbf985/body new file mode 100644 index 0000000..6c46db0 --- /dev/null +++ b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/2628eeca-96c6-4933-8484-d55bb1dbf985/body @@ -0,0 +1 @@ +Merged from bug 4a4609c8-1882-47de-9d30-fee410b8a802
\ No newline at end of file diff --git a/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/2628eeca-96c6-4933-8484-d55bb1dbf985/values b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/2628eeca-96c6-4933-8484-d55bb1dbf985/values new file mode 100644 index 0000000..afd88e5 --- /dev/null +++ b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/2628eeca-96c6-4933-8484-d55bb1dbf985/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Thu, 04 Dec 2008 17:05:49 +0000 + + +From: W. Trevor King <wking@drexel.edu> + diff --git a/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/942cd941-583d-4020-99e4-80de7e836129/body b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/942cd941-583d-4020-99e4-80de7e836129/body new file mode 100644 index 0000000..d0b8404 --- /dev/null +++ b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/942cd941-583d-4020-99e4-80de7e836129/body @@ -0,0 +1 @@ +Implemented. diff --git a/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/942cd941-583d-4020-99e4-80de7e836129/values b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/942cd941-583d-4020-99e4-80de7e836129/values new file mode 100644 index 0000000..366395d --- /dev/null +++ b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/942cd941-583d-4020-99e4-80de7e836129/values @@ -0,0 +1,11 @@ +Content-type: text/plain + + +Date: Thu, 04 Dec 2008 15:42:07 +0000 + + +From: W. Trevor King <wking@drexel.edu> + + +In-reply-to: 2628eeca-96c6-4933-8484-d55bb1dbf985 + diff --git a/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/ae0f9aea-960c-42b4-82df-943bbbe17d58/body b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/ae0f9aea-960c-42b4-82df-943bbbe17d58/body new file mode 100644 index 0000000..f7659c3 --- /dev/null +++ b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/ae0f9aea-960c-42b4-82df-943bbbe17d58/body @@ -0,0 +1 @@ +Per-tree severity and status levels are now supported. diff --git a/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/ae0f9aea-960c-42b4-82df-943bbbe17d58/values b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/ae0f9aea-960c-42b4-82df-943bbbe17d58/values new file mode 100644 index 0000000..80e328b --- /dev/null +++ b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/comments/ae0f9aea-960c-42b4-82df-943bbbe17d58/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Thu, 04 Dec 2008 17:07:25 +0000 + + +From: W. Trevor King <wking@drexel.edu> + diff --git a/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/values b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/values index 8a5d9e2..2f65fbc 100644 --- a/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/values +++ b/.be/bugs/ae998b27-a11b-4243-abf6-11841e5b8242/values @@ -1,28 +1,11 @@ +creator: abentley +severity: minor -creator=abentley +status: fixed - - - -severity=minor - - - - - - -status=open - - - - - - -summary=Customizable severity levels? - - +summary: Customizable severity levels? diff --git a/.be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/comments/f05359f6-1bfc-4aa6-9a6d-673516bc0f94/values b/.be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/comments/f05359f6-1bfc-4aa6-9a6d-673516bc0f94/values index cb5a094..e964891 100644 --- a/.be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/comments/f05359f6-1bfc-4aa6-9a6d-673516bc0f94/values +++ b/.be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/comments/f05359f6-1bfc-4aa6-9a6d-673516bc0f94/values @@ -1,21 +1,8 @@ +Content-type: text/plain - -Content-type=text/plain - - - - - - -Date=Sat, 15 Nov 2008 23:56:51 +0000 - - - - - - -From=wking +Date: Sat, 15 Nov 2008 23:56:51 +0000 +From: wking diff --git a/.be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/values b/.be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/values index d6d5870..29d76c7 100644 --- a/.be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/values +++ b/.be/bugs/cf56e648-3b09-4131-8847-02dff12b4db2/values @@ -1,35 +1,15 @@ +creator: abentley +severity: critical -creator=abentley +status: closed +summary: OK, maybe not fatal, but how about a new name that suggests process tracking, + not just bugs? - -severity=critical - - - - - - -status=open - - - - - - -summary=OK, maybe not fatal, but how about a new name that suggests process tracking, not just bugs? - - - - - - -time=Fri, 27 Jan 2006 14:37:25 +0000 - - +time: Fri, 27 Jan 2006 14:37:25 +0000 diff --git a/.be/bugs/f70dd5df-805b-49f3-a9ce-12e0fae63365/comments/24903c62-f441-496e-9dcf-17e7a581df33/body b/.be/bugs/f70dd5df-805b-49f3-a9ce-12e0fae63365/comments/24903c62-f441-496e-9dcf-17e7a581df33/body new file mode 100644 index 0000000..dd40bfa --- /dev/null +++ b/.be/bugs/f70dd5df-805b-49f3-a9ce-12e0fae63365/comments/24903c62-f441-496e-9dcf-17e7a581df33/body @@ -0,0 +1 @@ +Aaron said this was closeable in Nov. 24th email to the BE list. diff --git a/.be/bugs/f70dd5df-805b-49f3-a9ce-12e0fae63365/comments/24903c62-f441-496e-9dcf-17e7a581df33/values b/.be/bugs/f70dd5df-805b-49f3-a9ce-12e0fae63365/comments/24903c62-f441-496e-9dcf-17e7a581df33/values new file mode 100644 index 0000000..7bf391a --- /dev/null +++ b/.be/bugs/f70dd5df-805b-49f3-a9ce-12e0fae63365/comments/24903c62-f441-496e-9dcf-17e7a581df33/values @@ -0,0 +1,8 @@ +Content-type: text/plain + + +Date: Thu, 04 Dec 2008 17:20:20 +0000 + + +From: W. Trevor King <wking@drexel.edu> + diff --git a/.be/bugs/f70dd5df-805b-49f3-a9ce-12e0fae63365/values b/.be/bugs/f70dd5df-805b-49f3-a9ce-12e0fae63365/values index 7305e89..dde51b9 100644 --- a/.be/bugs/f70dd5df-805b-49f3-a9ce-12e0fae63365/values +++ b/.be/bugs/f70dd5df-805b-49f3-a9ce-12e0fae63365/values @@ -1,35 +1,14 @@ +creator: abentley +severity: minor -creator=abentley +status: closed +summary: Allow different sorts - -severity=minor - - - - - - -status=open - - - - - - -summary=Allow different sorts - - - - - - -time=Wed, 25 Jan 2006 15:43:19 +0000 - - +time: Wed, 25 Jan 2006 15:43:19 +0000 diff --git a/.be/settings b/.be/settings index 47dda13..a9bd6dd 100644 --- a/.be/settings +++ b/.be/settings @@ -1,7 +1,13 @@ - - - -rcs_name=bzr - - +inactive_status: +- - closed + - The bug is no longer relevant. +- - fixed + - The bug should no longer occur. +- - wontfix + - It's not a bug, it's a feature. +- - disabled + - Unknown meaning. For backwards compatibility with old BE bugs. + + +rcs_name: bzr diff --git a/becommands/list.py b/becommands/list.py index ff340e3..8c69eaa 100644 --- a/becommands/list.py +++ b/becommands/list.py @@ -15,9 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """List bugs""" -from libbe import cmdutil, bugdir -from libbe.bug import cmp_full, severity_values, status_values, \ - active_status_values, inactive_status_values +from libbe import cmdutil, bugdir, bug import os __desc__ = __doc__ @@ -43,13 +41,13 @@ def execute(args, test=False): # select status if options.status != None: if options.status == "all": - status = status_values + status = bug.status_values else: status = options.status.split(',') else: status = [] if options.active == True: - status.extend(list(active_status_values)) + status.extend(list(bug.active_status_values)) if options.unconfirmed == True: status.append("unconfirmed") if options.open == True: @@ -57,11 +55,11 @@ def execute(args, test=False): if options.test == True: status.append("test") if status == []: # set the default value - status = active_status_values + status = bug.active_status_values # select severity if options.severity != None: if options.severity == "all": - severity = severity_values + severity = bug.severity_values else: severity = options.severity.split(',') else: @@ -69,10 +67,10 @@ def execute(args, test=False): if options.wishlist == True: severity.extend("wishlist") if options.important == True: - serious = severity_values.index("serious") - severity.append(list(severity_values[serious:])) + serious = bug.severity_values.index("serious") + severity.append(list(bug.severity_values[serious:])) if severity == []: # set the default value - severity = severity_values + severity = bug.severity_values # select assigned if options.assigned != None: if options.assigned == "all": @@ -117,15 +115,15 @@ def execute(args, test=False): print "No matching bugs found" def list_bugs(cur_bugs, title=None, just_uuids=False): - cur_bugs.sort(cmp_full) + cur_bugs.sort(bug.cmp_full) if len(cur_bugs) > 0: if title != None: print cmdutil.underlined(title) - for bug in cur_bugs: + for bg in cur_bugs: if just_uuids: - print bug.uuid + print bg.uuid else: - print bug.string(shortlist=True) + print bg.string(shortlist=True) list_bugs(bugs, just_uuids=options.uuids) @@ -158,7 +156,9 @@ def get_parser(): dest=attr, help=help) return parser -longhelp=""" + +def help(): + longhelp=""" This command lists bugs. Normally it prints a short string like 576:om: Allow attachments Where @@ -189,19 +189,17 @@ target In addition, there are some shortcut options that set boolean flags. The boolean options are ignored if the matching string option is used. -""" % (','.join(status_values), - ','.join(severity_values)) - -def help(): +""" % (','.join(bug.status_values), + ','.join(bug.severity_values)) return get_parser().help_str() + longhelp def complete(options, args, parser): for option, value in cmdutil.option_value_pairs(options, parser): if value == "--complete": if option == "status": - raise cmdutil.GetCompletions(status_values) + raise cmdutil.GetCompletions(bug.status_values) elif option == "severity": - raise cmdutil.GetCompletions(severity_values) + raise cmdutil.GetCompletions(bug.severity_values) raise cmdutil.GetCompletions() if "--complete" in args: raise cmdutil.GetCompletions() # no positional arguments for list diff --git a/becommands/merge.py b/becommands/merge.py index 9f324f7..927bb63 100644 --- a/becommands/merge.py +++ b/becommands/merge.py @@ -52,6 +52,7 @@ def execute(args, test=False): Status : open Assigned : Target : + Reporter : Creator : John Doe <jdoe@example.com> Created : Wed, 31 Dec 1969 19:00 (Thu, 01 Jan 1970 00:00:00 +0000) Bug A @@ -96,6 +97,7 @@ def execute(args, test=False): Status : closed Assigned : Target : + Reporter : Creator : Jane Doe <jdoe@example.com> Created : Wed, 31 Dec 1969 19:00 (Thu, 01 Jan 1970 00:00:00 +0000) Bug B diff --git a/becommands/new.py b/becommands/new.py index dec40cb..1c5246c 100644 --- a/becommands/new.py +++ b/becommands/new.py @@ -29,12 +29,12 @@ def execute(args, test=False): Created bug with ID X >>> bd.load() >>> bug = bd.bug_from_uuid("X") - >>> bug.summary - u'this is a test' + >>> print bug.summary + this is a test >>> bug.time <= int(time.time()) True - >>> bug.severity - u'minor' + >>> print bug.severity + minor >>> bug.target == settings_object.EMPTY True """ @@ -49,6 +49,10 @@ def execute(args, test=False): bug.reporter = options.reporter else: bug.reporter = bug.creator + if options.assigned != None: + bug.assigned = options.assigned + elif bd.default_assignee != settings_object.EMPTY: + bug.assigned = bd.default_assignee bd.save() print "Created bug with ID %s" % bd.bug_shortname(bug) @@ -56,6 +60,8 @@ def get_parser(): parser = cmdutil.CmdOptionParser("be new SUMMARY") parser.add_option("-r", "--reporter", metavar="REPORTER", dest="reporter", help="The user who reported the bug", default=None) + parser.add_option("-a", "--assigned", metavar="ASSIGNED", dest="assigned", + help="The developer in charge of the bug", default=None) return parser longhelp=""" diff --git a/becommands/severity.py b/becommands/severity.py index 7b7ee29..5d27222 100644 --- a/becommands/severity.py +++ b/becommands/severity.py @@ -15,8 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """Show or change a bug's severity level""" -from libbe import cmdutil, bugdir -from libbe.bug import severity_values, severity_description +from libbe import cmdutil, bugdir, bug __desc__ = __doc__ def execute(args, test=False): @@ -35,8 +34,7 @@ def execute(args, test=False): """ parser = get_parser() options, args = parser.parse_args(args) - cmdutil.default_complete(options, args, parser, - bugid_args={0: lambda bug : bug.active==True}) + complete(options, args, parser) if len(args) not in (1,2): raise cmdutil.UsageError bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test) @@ -56,7 +54,8 @@ def get_parser(): parser = cmdutil.CmdOptionParser("be severity BUG-ID [SEVERITY]") return parser -longhelp=[""" +def help(): + longhelp=[""" Show or change a bug's severity level. If no severity is specified, the current value is printed. If a severity level @@ -64,13 +63,38 @@ is specified, it will be assigned to the bug. Severity levels are: """] -longest_severity_len = max([len(s) for s in severity_values]) -for severity in severity_values : - description = severity_description[severity] - s = "%*s : %s\n" % (longest_severity_len, severity, description) - longhelp.append(s) -longhelp = ''.join(longhelp) - - -def help(): + try: # See if there are any per-tree severity configurations + bd = bugdir.BugDir(from_disk=True, manipulate_encodings=False) + except bugdir.NoBugDir, e: + pass # No tree, just show the defaults + longest_severity_len = max([len(s) for s in bug.severity_values]) + for severity in bug.severity_values : + description = bug.severity_description[severity] + s = "%*s : %s\n" % (longest_severity_len, severity, description) + longhelp.append(s) + longhelp = ''.join(longhelp) return get_parser().help_str() + longhelp + +def complete(options, args, parser): + for option,value in cmdutil.option_value_pairs(options, parser): + if value == "--complete": + # no argument-options at the moment, so this is future-proofing + raise cmdutil.GetCompletions() + for pos,value in enumerate(args): + if value == "--complete": + try: # See if there are any per-tree severity configurations + bd = bugdir.BugDir(from_disk=True, + manipulate_encodings=False) + except bugdir.NoBugDir: + bd = None + if pos == 0: # fist positional argument is a bug id + ids = [] + if bd != None: + bd.load_all_bugs() + filter = lambda bg : bg.active==True + bugs = [bg for bg in bd if filter(bg)==True] + ids = [bd.bug_shortname(bg) for bg in bugs] + raise cmdutil.GetCompletions(ids) + elif pos == 1: # second positional argument is a severity + raise cmdutil.GetCompletions(bug.severity_values) + raise cmdutil.GetCompletions() diff --git a/becommands/show.py b/becommands/show.py index 37168c1..87b890f 100644 --- a/becommands/show.py +++ b/becommands/show.py @@ -30,6 +30,7 @@ def execute(args, test=False): Status : open Assigned : Target : + Reporter : Creator : John Doe <jdoe@example.com> Created : Wed, 31 Dec 1969 19:00 (Thu, 01 Jan 1970 00:00:00 +0000) Bug A diff --git a/becommands/status.py b/becommands/status.py index 5ff824e..40e9b51 100644 --- a/becommands/status.py +++ b/becommands/status.py @@ -15,8 +15,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """Show or change a bug's status""" -from libbe import cmdutil, bugdir -from libbe.bug import status_values, status_description +from libbe import cmdutil, bugdir, bug __desc__ = __doc__ def execute(args, test=False): @@ -35,8 +34,7 @@ def execute(args, test=False): """ parser = get_parser() options, args = parser.parse_args(args) - cmdutil.default_complete(options, args, parser, - bugid_args={0: lambda bug : True}) + complete(options, args, parser) if len(args) not in (1,2): raise cmdutil.UsageError bd = bugdir.BugDir(from_disk=True, manipulate_encodings=not test) @@ -56,20 +54,46 @@ def get_parser(): parser = cmdutil.CmdOptionParser("be status BUG-ID [STATUS]") return parser -longhelp=[""" -Show or change a bug's severity level. -If no severity is specified, the current value is printed. If a severity level +def help(): + longhelp=[""" +Show or change a bug's status. + +If no status is specified, the current value is printed. If a status is specified, it will be assigned to the bug. -Severity levels are: +Status levels are: """] -longest_status_len = max([len(s) for s in status_values]) -for status in status_values : - description = status_description[status] - s = "%*s : %s\n" % (longest_status_len, status, description) - longhelp.append(s) -longhelp = ''.join(longhelp) - -def help(): + try: # See if there are any per-tree status configurations + bd = bugdir.BugDir(from_disk=True, manipulate_encodings=False) + except bugdir.NoBugDir, e: + pass # No tree, just show the defaults + longest_status_len = max([len(s) for s in bug.status_values]) + for status in bug.status_values : + description = bug.status_description[status] + s = "%*s : %s\n" % (longest_status_len, status, description) + longhelp.append(s) + longhelp = ''.join(longhelp) return get_parser().help_str() + longhelp + +def complete(options, args, parser): + for option,value in cmdutil.option_value_pairs(options, parser): + if value == "--complete": + # no argument-options at the moment, so this is future-proofing + raise cmdutil.GetCompletions() + for pos,value in enumerate(args): + if value == "--complete": + try: # See if there are any per-tree status configurations + bd = bugdir.BugDir(from_disk=True, + manipulate_encodings=False) + except bugdir.NoBugDir: + bd = None + if pos == 0: # fist positional argument is a bug id + ids = [] + if bd != None: + bd.load_all_bugs() + ids = [bd.bug_shortname(bg) for bg in bd] + raise cmdutil.GetCompletions(ids) + elif pos == 1: # second positional argument is a status + raise cmdutil.GetCompletions(bug.status_values) + raise cmdutil.GetCompletions() diff --git a/libbe/bug.py b/libbe/bug.py index 14f3db0..f871c7a 100644 --- a/libbe/bug.py +++ b/libbe/bug.py @@ -34,9 +34,9 @@ import utility # Use a tuple of (category, description) tuples since we don't have # ordered dicts in Python yet http://www.python.org/dev/peps/pep-0372/ -# in order of increasing severity -severity_level_def = ( - ("wishlist","A feature that could improve usefullness, but not a bug."), +# in order of increasing severity. (name, description) pairs +severity_def = ( + ("wishlist","A feature that could improve usefulness, but not a bug."), ("minor","The standard bug level."), ("serious","A bug that requires workarounds."), ("critical","A bug that prevents some features from working at all."), @@ -52,25 +52,50 @@ active_status_def = ( inactive_status_def = ( ("closed", "The bug is no longer relevant."), ("fixed", "The bug should no longer occur."), - ("wontfix","It's not a bug, it's a feature."), - ("disabled", "?")) + ("wontfix","It's not a bug, it's a feature.")) ### Convert the description tuples to more useful formats -severity_values = tuple([val for val,description in severity_level_def]) -severity_description = dict(severity_level_def) +severity_values = () +severity_description = {} severity_index = {} -for i in range(len(severity_values)): - severity_index[severity_values[i]] = i - -active_status_values = tuple(val for val,description in active_status_def) -inactive_status_values = tuple(val for val,description in inactive_status_def) -status_values = active_status_values + inactive_status_values -status_description = dict(active_status_def+inactive_status_def) +def load_severities(severity_def): + global severity_values + global severity_description + global severity_index + if severity_def == settings_object.EMPTY: + return + severity_values = tuple([val for val,description in severity_def]) + severity_description = dict(severity_def) + severity_index = {} + for i,severity in enumerate(severity_values): + severity_index[severity] = i +load_severities(severity_def) + +active_status_values = [] +inactive_status_values = [] +status_values = [] +status_description = {} status_index = {} -for i in range(len(status_values)): - status_index[status_values[i]] = i +def load_status(active_status_def, inactive_status_def): + global active_status_values + global inactive_status_values + global status_values + global status_description + global status_index + if active_status_def == settings_object.EMPTY: + active_status_def = globals()["active_status_def"] + if inactive_status_def == settings_object.EMPTY: + inactive_status_def = globals()["inactive_status_def"] + active_status_values = tuple([val for val,description in active_status_def]) + inactive_status_values = tuple([val for val,description in inactive_status_def]) + status_values = active_status_values + inactive_status_values + status_description = dict(tuple(active_status_def) + tuple(inactive_status_def)) + status_index = {} + for i,status in enumerate(status_values): + status_index[status] = i +load_status(active_status_def, inactive_status_def) class Bug(settings_object.SavedSettingsObject): @@ -113,14 +138,14 @@ class Bug(settings_object.SavedSettingsObject): @_versioned_property(name="severity", doc="A measure of the bug's importance", default="minor", - allowed=severity_values, + check_fn=lambda s: s in severity_values, require_save=True) def severity(): return {} @_versioned_property(name="status", doc="The bug's current status", default="open", - allowed=status_values, + check_fn=lambda s: s in status_values, require_save=True) def status(): return {} diff --git a/libbe/bugdir.py b/libbe/bugdir.py index f93576f..98110dd 100644 --- a/libbe/bugdir.py +++ b/libbe/bugdir.py @@ -170,12 +170,17 @@ class BugDir (list, settings_object.SavedSettingsObject): @_versioned_property(name="user_id", doc= -"""The user's prefered name, e.g 'John Doe <jdoe@example.com>'. Note +"""The user's prefered name, e.g. 'John Doe <jdoe@example.com>'. Note that the Arch RCS backend *enforces* ids with this format.""", change_hook=_set_user_id, generator=_guess_user_id) def user_id(): return {} + @_versioned_property(name="default_assignee", + doc= +"""The default assignee for new bugs e.g. 'John Doe <jdoe@example.com>'.""") + def default_assignee(): return {} + @_versioned_property(name="rcs_name", doc="""The name of the current RCS. Kept seperate to make saving/loading settings easy. Don't set this attribute. Set .rcs instead, and @@ -218,6 +223,35 @@ settings easy. Don't set this attribute. Set .rcs instead, and @doc_property(doc="A dict of (bug-uuid, bug-instance) pairs.") def _bug_map(): return {} + def _setup_severities(self, severities): + if severities != None and severities != settings_object.EMPTY: + bug.load_severities(severities) + def _set_severities(self, old_severities, new_severities): + self._setup_severities(new_severities) + self._prop_save_settings(old_severities, new_severities) + @_versioned_property(name="severities", + doc="The allowed bug severities and their descriptions.", + change_hook=_set_severities) + def severities(): return {} + + def _setup_status(self, active_status, inactive_status): + bug.load_status(active_status, inactive_status) + def _set_active_status(self, old_active_status, new_active_status): + self._setup_status(new_active_status, self.inactive_status) + self._prop_save_settings(old_active_status, new_active_status) + @_versioned_property(name="active_status", + doc="The allowed active bug states and their descriptions.", + change_hook=_set_active_status) + def active_status(): return {} + + def _set_inactive_status(self, old_inactive_status, new_inactive_status): + self._setup_status(self.active_status, new_inactive_status) + self._prop_save_settings(old_inactive_status, new_inactive_status) + @_versioned_property(name="inactive_status", + doc="The allowed inactive bug states and their descriptions.", + change_hook=_set_inactive_status) + def inactive_status(): return {} + def __init__(self, root=None, sink_to_existing_root=True, assert_new_BugDir=False, allow_rcs_init=False, @@ -318,6 +352,8 @@ settings easy. Don't set this attribute. Set .rcs instead, and self.rcs = rcs.rcs_by_name(self.rcs_name) self._setup_encoding(self.encoding) + self._setup_severities(self.severities) + self._setup_status(self.active_status, self.inactive_status) def load_all_bugs(self): "Warning: this could take a while." @@ -369,7 +405,10 @@ settings easy. Don't set this attribute. Set .rcs instead, and if "rcs_name" in duplicate_settings: duplicate_settings["rcs_name"] = "None" duplicate_settings["user_id"] = self.user_id - self._save_settings(duplicate_settings_path, duplicate_settings) + if "disabled" in bug.status_values: + # Hack to support old versions of BE bugs + duplicate_settings["inactive_status"] = self.inactive_status + self._save_settings(duplicate_settings_path, duplicate_settings) return BugDir(duplicate_path, from_disk=True, manipulate_encodings=self._manipulate_encodings) diff --git a/libbe/cmdutil.py b/libbe/cmdutil.py index eefed58..6be7540 100644 --- a/libbe/cmdutil.py +++ b/libbe/cmdutil.py @@ -97,11 +97,13 @@ def raise_get_help(option, opt, value, parser): raise GetHelp def raise_get_completions(option, opt, value, parser): + print "got completion arg" raise GetCompletions(completions(sys.argv[1])) class CmdOptionParser(optparse.OptionParser): def __init__(self, usage): optparse.OptionParser.__init__(self, usage) + self.disable_interspersed_args() self.remove_option("-h") self.add_option("-h", "--help", action="callback", callback=raise_get_help, help="Print a help message") diff --git a/libbe/comment.py b/libbe/comment.py index 6c0e5c0..cb5ea59 100644 --- a/libbe/comment.py +++ b/libbe/comment.py @@ -275,6 +275,8 @@ class Comment(Tree, settings_object.SavedSettingsObject): self._setup_saved_settings() def save_settings(self): + parent_dir = os.path.dirname(self.get_path()) + self.rcs.mkdir(parent_dir) self.rcs.mkdir(self.get_path()) path = self.get_path("values") mapfile.map_save(self.rcs, path, self._get_saved_settings()) diff --git a/libbe/diff.py b/libbe/diff.py index 5fc0166..17d6c50 100644 --- a/libbe/diff.py +++ b/libbe/diff.py @@ -15,9 +15,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """Compare two bug trees""" -from libbe import cmdutil, bugdir +from libbe import cmdutil, bugdir, bug from libbe.utility import time_to_str -from libbe.bug import cmp_severity import doctest def diff(old_bugdir, new_bugdir): @@ -41,17 +40,17 @@ def diff(old_bugdir, new_bugdir): def diff_report(diff_data, bug_dir): (removed, modified, added) = diff_data def modified_cmp(left, right): - return cmp_severity(left[1], right[1]) + return bug.cmp_severity(left[1], right[1]) - added.sort(cmp_severity) - removed.sort(cmp_severity) + added.sort(bug.cmp_severity) + removed.sort(bug.cmp_severity) modified.sort(modified_cmp) lines = [] if len(added) > 0: lines.append("New bug reports:") - for bug in added: - lines.extend(bug.string(shortlist=True).splitlines()) + for bg in added: + lines.extend(bg.string(shortlist=True).splitlines()) lines.append("") if len(modified) > 0: @@ -69,8 +68,8 @@ def diff_report(diff_data, bug_dir): if len(removed) > 0: lines.append("Removed bug reports:") - for bug in removed: - lines.extend(bug.string(shortlist=True).splitlines()) + for bg in removed: + lines.extend(bg.string(shortlist=True).splitlines()) lines.append("") return '\n'.join(lines) diff --git a/libbe/mapfile.py b/libbe/mapfile.py index 559d713..c36d454 100644 --- a/libbe/mapfile.py +++ b/libbe/mapfile.py @@ -14,6 +14,7 @@ # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +import yaml import os.path import errno import utility @@ -29,17 +30,20 @@ class IllegalValue(Exception): Exception.__init__(self, 'Illegal value "%s"' % value) self.value = value -def generate(map, context=3): - """Generate a format-2 mapfile content string. This is a simpler - format, but should merge better, because there's no chance of - confusion for appends, and lines are unique for both key and - value. - +def generate(map): + """Generate a YAML mapfile content string. >>> generate({"q":"p"}) - '\\n\\n\\nq=p\\n\\n\\n\\n' + 'q: p\\n\\n' + >>> generate({"q":u"Fran\u00e7ais"}) + 'q: Fran\\xc3\\xa7ais\\n\\n' + >>> generate({"q":u"hello"}) + 'q: hello\\n\\n' >>> generate({"q=":"p"}) Traceback (most recent call last): IllegalKey: Illegal key "q=" + >>> generate({"q:":"p"}) + Traceback (most recent call last): + IllegalKey: Illegal key "q:" >>> generate({"q\\n":"p"}) Traceback (most recent call last): IllegalKey: Illegal key "q\\n" @@ -53,7 +57,6 @@ def generate(map, context=3): Traceback (most recent call last): IllegalValue: Illegal value "p\\n" """ - assert(context > 0) keys = map.keys() keys.sort() for key in keys: @@ -61,6 +64,7 @@ def generate(map, context=3): assert not key.startswith('>') assert('\n' not in key) assert('=' not in key) + assert(':' not in key) assert(len(key) > 0) except AssertionError: raise IllegalKey(key.encode('string_escape')) @@ -69,20 +73,19 @@ def generate(map, context=3): lines = [] for key in keys: - for i in range(context): - lines.append("") - lines.append("%s=%s" % (key, map[key])) - for i in range(context): - lines.append("") - return '\n'.join(lines) + '\n' + lines.append(yaml.safe_dump({key: map[key]}, + default_flow_style=False, + allow_unicode=True)) + lines.append("") + return '\n'.join(lines) def parse(contents): """ - Parse a format-2 mapfile string. - >>> parse('\\n\\n\\nq=p\\n\\n\\n\\n')['q'] + Parse a YAML mapfile string. + >>> parse('q: p\\n\\n')['q'] + 'p' + >>> parse('q: \\'p\\'\\n\\n')['q'] 'p' - >>> parse('\\n\\nq=\\'p\\'\\n\\n\\n\\n')['q'] - "\'p\'" >>> contents = generate({"a":"b", "c":"d", "e":"f"}) >>> dict = parse(contents) >>> dict["a"] @@ -92,15 +95,25 @@ def parse(contents): >>> dict["e"] 'f' """ - result = {} + old_format = False for line in contents.splitlines(): - line = line.rstrip('\n') - if len(line) == 0: - continue - name,value = [field for field in line.split('=', 1)] - assert not result.has_key(name) - result[name] = value - return result + if len(line.split("=")) == 2: + old_format = True + break + if old_format: # translate to YAML. Hack to deal with old BE bugs. + newlines = [] + for line in contents.splitlines(): + line = line.rstrip('\n') + if len(line) == 0: + continue + fields = line.split("=") + if len(fields) == 2: + key,value = fields + newlines.append('%s: "%s"' % (key, value.replace('"','\\"'))) + else: + newlines.append(line) + contents = '\n'.join(newlines) + return yaml.load(contents) def map_save(rcs, path, map, allow_no_rcs=False): """Save the map as a mapfile to the specified path""" |