Commit Graph

81 Commits

Author SHA1 Message Date
Matt Mackall
cb4824284b merge with stable 2012-06-06 21:17:33 -05:00
Jim Hague
1b46810a77 bugzilla: stop bugs always being marked as fixed in xmlrpc (issue3484)
Bugs should only be marked fixed if the comment parser gives them the
fixed state. xmlrpc+email got this right, xmlrpc screwed it up.
2012-06-06 16:44:17 +01:00
Augie Fackler
96d44b39f7 hgext: mark all first-party extensions as such 2012-05-15 14:37:49 -05:00
Brodie Rao
d6a6abf2b0 cleanup: eradicate long lines 2012-05-12 15:54:54 +02:00
Steven Stallion
66e5651b6d bugzilla: fix transport initialization on python 2.4 2012-05-11 22:48:19 -07:00
Matt Mackall
4a144a5db5 merge with stable 2012-03-04 16:48:04 -06:00
Jim Hague
cad5cac971 bugzilla: add xmlrpcemail submission for Bugzilla 3.6 email interface
Some of the formatting details required for bug submission via email
changed between Bugzilla 3.4 and 3.6. Bugzilla 3.4 requires lines of
the form '@fieldname = value', while 3.6 wants '@fieldname value'.
Also the field @bug_id in 3.4 becomes @id in 3.6.

Bugzilla up to and including 4.0 also recognises the 3.4 format. To save
surprises in the future, check the Bugzilla version and use the 3.6
format from all major versions >= 4. At some point we will
drop support for Bugzilla prior to 3.6 and support the new format only.
2012-03-01 14:50:31 +00:00
Jim Hague
ef9d8e60cc bugzilla: allow change comment to mark bugs fixed
Add a second regular expression used when scanning change comments.
Bugs matched by this new regular expression have the bug comments and
optionally hours updated as with the first regular expression, but they
are also marked as fixed.

The bug status and resolution to set to mark a bug as fixed can be
configured. By default status is set to RESOLVED and resolution to
FIXED, the default Bugzilla settings.

For example, a change comment containing 'Fixes 1234 h1.5' will be
added to bug 1234, the bug will have its working time increased by
1.65 hours, and the bug will be marked RESOLVED/FIXED.

Change comments may contain both bug update and fix instructions. If
the same bug ID occurs in both, the last instruction found takes
precedence.

The patch adds new bug states 'bug_status' and 'resolution' and actions
to update them to the XMLRPC and XMLRPC/email access methods. XMLRPC does
not support marking bugs as fixed when used with Bugzilla versions prior
to 4.0. When used with an earlier Bugzilla version, a warning is issued
and only comment and hours updated.
2012-03-01 15:27:24 +00:00
Jim Hague
6c5c699aef bugzilla: extract optional hours from commit message and update bug time
If an 'hours' group is present in the bug matching regular expression,
and that group contains a float value, update the bug working time in
Bugzilla with those hours.

The patch adds a key 'hours' to the bug state dictionary, and adds
support for the key to the XMLRPC and XMLRPC/email access methods.
The MySQL access method is not supported; a warning is given.
2012-03-01 15:25:37 +00:00
Jim Hague
df2c50f6f8 bugzilla: modify access interface to include new bug states
As a first step to allowing comment text to update bug state, rework the
Bugzilla access interface to use a dictionary keyed on bug ID. Dictionary
entries will contain new state info in future changes.
2012-03-01 14:51:40 +00:00
Jim Hague
d51f75e5f8 bugzilla: correct comment typo 2012-03-01 14:42:23 +00:00
Jim Hague
dae7a893f8 bugzilla: stop XMLRPC requests from requesting gzipped responses
Python 2.7 introduced support for gzip encoding in xmlrpclib.Transport.
We do our own handling of responses, and don't currently support gzip encoding.
So to run successfully under Python 2.7 with a web server configured
to gzip encode, stop XMLRPC requests from announcing gzip encoding support.
2012-02-29 17:43:03 +00:00
Jim Hague
627ffc395e bugzilla: make XMLRPC interface support http and https access
Inadvertently support is currently only for https. For some reason I
thought xmlrpclib.SafeTransport did http and https, but it is https only.

So create http and https XMLRPC transports that retain cookies. Decide which
to use by inspecting the Bugzilla URL.
2012-01-11 16:54:29 +00:00
Wagner Bruna
e9d8028876 bugzilla: fix typo in documentation 2011-06-14 20:08:35 -03:00
Adrian Buehlmann
e94d06bb79 rename explain_exit to explainexit 2011-05-06 15:31:09 +02:00
Jim Hague
80a125d068 bugzilla: more documentation formatting fixups
Correct typo in numbering list of access methods.
Convert a section reference and a template parameter reference into
literal text, for consistency with other use.
2011-04-06 11:30:08 +01:00
Martin Geisler
9dfcd73e5b bugzilla: convert a verbatim block to a field list 2011-04-05 10:22:58 +02:00
Martin Geisler
3d9f5b0e1f bugzilla: fix reST error introduced in a2e32837d8f5
All blocks must be indented. Here we can use a field list instead of a
verbatim block for a real list layout.
2011-04-05 10:20:59 +02:00
Jim Hague
65534172e2 bugzilla: more documentation fixes
Correct formatting of the possible values of bugzilla.version.
Fix typo and polish XMLRPC/email mode description.
2011-04-04 17:37:18 +01:00
Jim Hague
3be6a4e3fe bugzilla: correct sample configurations
Use consistent sample domains and wording in all configuration examples.

Add missing template and strip parameters to XMLRPC examples and correct
Bugzilla URL key in XMLRPC+email.
2011-04-04 13:31:37 +01:00
Patrick Mezard
964b307b71 bugzilla: fix documentation typo 2011-04-01 20:40:27 +02:00
Martin Geisler
d8a6341a37 bugzilla: fix bad reST markup
The indented second line turned the first line into a description
header.
2011-04-01 12:30:40 +02:00
Martin Geisler
8cb176c788 bugzilla: markup literal text as such 2011-04-01 12:27:12 +02:00
Martin Geisler
0d1109205c bugzilla: refer to hgrc(5) man page with normal notation 2011-04-01 12:09:11 +02:00
Martin Geisler
459fedb4ee bugzilla: markup section names as literal text 2011-04-01 12:07:37 +02:00
Martin Geisler
f9635687a7 bugzilla: show usermap syntax more clearly 2011-04-01 12:05:19 +02:00
Martin Geisler
c285f18e77 bugzilla: use standard section.name notation 2011-04-01 12:03:23 +02:00
Martin Geisler
36682a123f bugzilla: prefix each config option with section 2011-04-01 12:00:57 +02:00
Martin Geisler
584b9eaf34 bugzilla: fix reStructuredText errors introduced in 4e52d7534ab2 2011-04-01 11:59:18 +02:00
Jim Hague
aee30b7a2e bugzilla: add modified XMLRPC mode that uses email to send bug comments.
If Bugzilla has its email interface configured, an email can be used
to update bugs. If the From: address in the email matches a valid user
email, Bugzillas make the update as that user. So comments attached to a
bug appear under the name of the user making the change, and the user
does not receive email about the change, exactly as if they had made
the change via the web interface.

So add a modified XMLRPC mode that uses email to modify bugs. The format
of the mails is documented in the Bugzilla email_in.pl specification.
Briefly, initial non-blank lines in the message body starting
'@<field> = <value> modify bug fields. A blank line signals the end of
the command lines, and the rest of the message is used as bug comment.

Invoke the same Mercurial user to Bugzilla user email mapping
currently used in the MySQL mode.

All other processing - checking the bug numbers, checking user ids, etc.
continues to be done via XMLRPC.
2011-03-30 09:49:45 +01:00
Jim Hague
50d39b606d bugzilla: add XMLRPC interface.
Add support for access to Bugzilla via the XMLRPC interface.

This requires a single username and password used to log in to Bugzilla,
plus the URL of the Bugzilla installation. Commit messages are added to
bugs as before, but security only permits them to be added as the
username used to log in.
2011-03-30 09:49:45 +01:00
Jim Hague
86c71c3e2f bugzilla: localise all MySQL direct access inside access class.
Prepare for the addition of other Bugzilla access methods by localising
direct MySQL database access inside an access class.

Provide a base access class largely to document the methods required for
a class implementing a particular access method.

Rename the 'bugzilla_<version>' classes to 'bzmysql_<version>' to
emphasise that they are doing access via direct manipulation of a
MySQL database.
2011-03-30 09:49:45 +01:00
Jim Hague
2813d6b869 bugzilla: keep bug IDs in set.
Bug IDs are collected into a set, and then silently converted in
filter_real_bug_ids() into a list. For consistency, keep them in
a set throughout and update the docstrings to say that.
2011-03-30 09:49:45 +01:00
Jim Hague
e369f66c45 bugzilla: rename filter_unknown_bug_ids to reflect its actual purpose.
The method really removes from the list of bugs any that already have
comment text referencing the changeset in question. Rename it to
filter_cset_known_bug_ids().
2011-03-30 09:49:45 +01:00
Renato Cunha
b6d6b8775c removed exception args indexing (not supported by py3k)
Py3k removed __getitem__ for exception classes. The correct way of
getting the exception arguments is by using the args method.
2010-07-14 23:03:21 -03:00
Dirkjan Ochtman
1a3040f895 bugzilla: revert unhelpful check-code changes, module is actually called MySQLdb 2010-02-15 09:57:11 +01:00
Matt Mackall
e8e49c5f78 bugzilla: lowercase mysqldb var 2010-01-28 22:45:04 -06:00
Matt Mackall
8d99be19f0 many, many trivial check-code fixups 2010-01-25 00:05:27 -06:00
Matt Mackall
595d66f424 Update license to GPLv2+ 2010-01-19 22:20:08 -06:00
Martin Geisler
70de345b15 hgext: enable extensions without "hgext." prefix in help texts 2009-12-22 00:50:03 +01:00
Martin Geisler
583a0ade5b bugzilla: wrap docstrings at 70 characters 2009-07-26 01:39:47 +02:00
Martin Geisler
49448c8739 bugzilla: wrap example template line 2009-07-23 00:21:46 +02:00
Martin Geisler
87f99d6b85 bugzilla: reformat list of configuration options 2009-07-23 00:20:18 +02:00
Martin Geisler
33d81f4d2a bugzilla: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Dirkjan Ochtman
c8e6583765 extensions: change descriptions for hook-providing extensions
Thanks to timeless and Dave Townsend for advice!
2009-06-24 13:42:34 +02:00
Cédric Duval
dbcec5595d extensions: improve the consistency of synopses
Trying as much as possible to consistently:
 - use a present tense predicate followed by a direct object
 - verb referring directly to the functionality provided
   (ie. not "add command that does this" but simple "do that")
 - keep simple and to the point, leaving details for the long help
   (width is tight, possibly even more so for translations)

Thanks to timeless, Martin Geisler, Rafael Villar Burke, Dan Villiom
Podlaski Christiansen and others for the helpful suggestions.
2009-06-22 15:48:08 +02:00
Benoit Boissinot
113cb64fdf bugzilla: use set instead of dict 2009-05-17 03:02:12 +02:00
Martin Geisler
750183bdad updated license to be explicit about GPL version 2 2009-04-26 01:08:54 +02:00
Matt Mackall
2f9b02c62d replace util.sort with sorted built-in
This is marginally faster for small and moderately-sized lists
2009-04-26 16:50:44 -05:00
Matt Mackall
416d312fe5 bugzilla: fix section reading 2009-04-26 16:50:43 -05:00