Commit Graph

124 Commits

Author SHA1 Message Date
Boris Feld
6f1d2b38ba configitems: register the 'bugzilla.notify' config 2017-06-30 03:30:13 +02:00
Boris Feld
401ff7a191 bugzilla: move the default regexp for fix in the config declaration
This mimic the change requested by Yuya for '_default_bug_re'.
2017-07-14 16:17:37 +02:00
Boris Feld
686cdbf81b configitems: register the 'bugzilla.version' config 2017-07-07 10:04:21 +02:00
Boris Feld
bb132489a6 configitems: register the 'bugzilla.usermap' config 2017-07-07 10:04:19 +02:00
Boris Feld
25a3b99028 configitems: register the 'bugzilla.user' config 2017-07-07 10:04:17 +02:00
Boris Feld
24b9a8bd04 configitems: register the 'bugzilla.timeout' config 2017-07-07 10:04:15 +02:00
Boris Feld
451b8af3c0 configitems: register the 'bugzilla.template' config 2017-07-07 10:04:13 +02:00
Boris Feld
c6fb9fca34 configitems: register the 'bugzilla.style' config 2017-07-07 10:04:11 +02:00
Boris Feld
d2874aad08 configitems: register the 'bugzilla.strip' config 2017-07-07 10:04:09 +02:00
Boris Feld
6c9b5d378e configitems: register the 'bugzilla.regexp' config
The default value is moved from the class to the config registration.
2017-07-07 10:04:07 +02:00
Boris Feld
7b61f9660d configitems: register the 'bugzilla.password' config 2017-07-07 10:04:05 +02:00
Boris Feld
b9e133d9eb configitems: register the 'bugzilla.host' config 2017-07-07 10:04:01 +02:00
Boris Feld
a7ef58bfca configitems: register the 'bugzilla.fixstatus' config 2017-07-07 10:03:57 +02:00
Boris Feld
aff813dbc9 configitems: register the 'bugzilla.fixresolution' config 2017-07-07 10:05:40 +02:00
Boris Feld
809c3cabc9 configitems: register the 'bugzilla.fixregexp' config 2017-07-07 10:03:36 +02:00
Boris Feld
7b06a431b5 configitems: register the 'bugzilla.db' config 2017-07-07 10:03:34 +02:00
Boris Feld
5441be5220 configitems: register the 'bugzilla.bzuser' config 2017-07-07 10:03:31 +02:00
Boris Feld
589f730567 configitems: register the 'bugzilla.bzurl' config 2017-07-07 10:03:28 +02:00
Boris Feld
f0dd13014a configitems: register the 'bugzilla.bzemail' config 2017-07-07 10:03:26 +02:00
Boris Feld
f8e8380065 configitems: register the 'bugzilla.bzdir' config 2017-07-07 10:03:24 +02:00
Boris Feld
ccb17357a1 configitems: register the 'bugzilla.apikey' config 2017-07-07 10:03:22 +02:00
Yuya Nishihara
5249aa5b36 cmdutil: pass templatespec tuple directly to changeset_templater (API)
A fewer number of arguments should be better.
2017-04-22 19:02:47 +09:00
Wagner Bruna
8d9192e033 bugzilla: fix typo in help text 2017-05-31 19:24:00 -03:00
Gregory Szorc
48793a9cc5 bugzilla: use util.urlreq.urlparse
And stop saving a module variable because it shouldn't be
necessary.
2017-03-21 22:39:52 -07:00
John Mulligan
01f8fb7c8f bugzilla: add a rest api backend (usable with bugzilla 5.0+)
Add support for the bugzilla rest api documented at
 https://wiki.mozilla.org/Bugzilla:REST_API
and at
 https://bugzilla.readthedocs.io/en/latest/

This backend has the following benefits:
* It supports the bugzilla api keys so hgrc does not need to contain
  a user's bugzilla password
* Works with Mercurial's "hostfingerprints" support making handling
  bugzilla instances with self-signed certs easier
* Does not use xmlrpc ;-)

Adds configuration item 'apikey' in [bugzilla] section.

My major concern with these patches is if the approach to HTTP access
is the right way for an extension and if hooking into request object
and the overriding the get_method to perform PUT requests was a
sensible approach.

# no-check-commit
2017-02-09 15:20:41 -05:00
Augie Fackler
ce63567c20 bugzilla: stop mentioning Pythons older than 2.6
We don't support those anyway.
2016-11-21 17:52:32 -05:00
Augie Fackler
4e1c384d0a extensions: change magic "shipped with hg" string
I've caught multiple extensions in the wild lying about being
'internal', so it's time to move the goalposts on people. Goalpost
moving will continue until third party extensions stop trying to
defeat the system.
2016-08-23 11:26:08 -04:00
Pulkit Goyal
fdc0861e35 py3: conditionalize xmlrpclib import
The xmlrpclib library is renamed to xmlrpc.client in python 3
2016-06-27 16:37:37 +05:30
Pulkit Goyal
5fcc6a2628 py3: conditionalize the urlparse import
The urlparse library is renamed to urllib.parse in python 3
2016-06-27 16:16:10 +05:30
Yuya Nishihara
59e8edaa91 bugzilla: do not load style file if template is specified (BC)
This prepares for the API change to support template aliases. I'm going to
extract a factory function of templater that reads a map file:

  # original
  templater(mapfile, ..., cache, ...)
  # new
  templater.frommapfile(mapfile, ...)  # read mapfile to build cache/map
  templater(..., cache, ...)           # use specified cache (= map elements)

This will make it clear to isolate stock styles (i.e. map files) from user
aliases. Template aliases should be applied to command arguments and templates
in hgrc, but not to map files. Otherwise, our stock styles and web templates
could be modified unintentionally.

This patch makes sure that either "tmpl" or "mapfile" is exclusively set. It's
theoretically a behavior change, since you could put new keywords in template
by defining them in a map file before:

  # mapfile
  foo = "{rev}"
  # hgrc
  [bugzilla]
  style = mapfile
  template = {foo}

But the old behavior would be a bug because bugzilla.template is documented
as "overrides style if specified". Also, common log-like templates and
formatter doesn't allow using mapfile-keywords in a separate template. So
I decided to make a BC.

Since there was no test for the bugzilla extension, this adds new test that
covers style/template output.
2016-04-04 22:48:34 +09:00
Gregory Szorc
6dc0d92138 bugzilla: use absolute_import 2016-02-09 17:31:50 -08:00
Pierre-Yves David
30913031d4 error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.

For great justice.
2015-10-08 12:55:45 -07:00
Gregory Szorc
5380dea2a7 global: mass rewrite to use modern exception syntax
Python 2.6 introduced the "except type as instance" syntax, replacing
the "except type, instance" syntax that came before. Python 3 dropped
support for the latter syntax. Since we no longer support Python 2.4 or
2.5, we have no need to continue supporting the "except type, instance".

This patch mass rewrites the exception syntax to be Python 2.6+ and
Python 3 compatible.

This patch was produced by running `2to3 -f except -w -n .`.
2015-06-23 22:20:08 -07:00
Augie Fackler
f95a6caba1 extensions: document that testedwith = 'internal' is special
Extension authors (notably at companies using hg) have been
cargo-culting the `testedwith = 'internal'` bit from hg's own
extensions, which then defeats our "file bugs over here" logic in
dispatch. Let's be more aggressive about trying to give extension
authors a hint about what testedwith should say.
2015-04-28 16:44:37 -04:00
Yuya Nishihara
71c4aa007f templater: remove noop calls of parsestring(s, quoted=False) (API)
Since e926f2ef639a, parsestring(s, quoted=False) just returns s.
2015-05-04 10:01:03 +09:00
Jim Hague
15bbbb3991 bugzilla: stop trying to cache setup across hook invocation
In the context of standalone Hg receiving a set of incoming changes, it makes
sense for the Bugzilla module to cache basic setup to avoid reconnecting
to Bugzilla for each change. After processing the changes, Hg will exit
and so the connection is short-lived.

But this doesn't work too well when used from a long-lived environment
such as hgweb or Kallithea where, for example, the connection can time out.
So take the simple approach, abandon the cache and do the basic setup on
each call. This fixes current problems with Kallithea.
2014-07-03 10:48:37 +01:00
Jim Hague
a8d33ec9dd bugzilla: correct config documentation error
The config documentation specifies the wrong access method in the XMLRPC+email
configuration.
2014-07-03 10:56:03 +01:00
Jim Hague
14c4476395 bugzilla: support Bugzilla 4.4.3+ API login token authentication (issue4257)
Bugzilla 4.4.3 and later remove the old cookie based session authentication
from the Web Services API and replace it with a login token. The session
can now also be restricted to the originating IP.

Add the necessary to the extension so it works with 4.4.3 and later.
2014-05-23 17:29:04 +01:00
Augie Fackler
98c42c8081 bugzilla: move from dict() construction to {} literals
The latter are both faster and more consistent across Python 2 and 3.
2014-03-12 13:13:10 -04:00
Matt Mackall
694de7920e changeset_templater: remove use_template method 2014-03-08 16:14:08 -06:00
Bryan O'Sullivan
dc9ede17dc Merge spelling fixes 2012-09-11 08:36:09 -07:00
timeless@mozdev.org
49f2d80b82 en-us: recognized 2012-08-17 13:58:19 -07:00
Mads Kiilerich
2f4504e446 fix trivial spelling errors 2012-08-15 22:38:42 +02:00
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