patch which enables hgext/bugzilla.py to work with bugzilla v2.22.1

Benoit Boissinot bboissin at gmail.com
Tue Oct 2 13:52:00 CDT 2007


On 10/2/07, Nick <lonnc2000 at yahoo.co.uk> wrote:
> Hi,
>
> Have only just started using mercurial, so hope I am following the right
> procedure.

Thanks for your patch, I have a couple a comments below.

> # HG changeset patch
> # User lonnc2000 at yahoo.co.uk
> # Date 1191331879 -3600
> # Node ID 50de1188eb929978764b351d384ec7d5745d9791
> # Parent  9189ae05467d36217f85970b585177bb5bcdc23b
> Added support for bugzilla v2.22.1.

We usually add a blank line after the short summary

> No actual code changes were required. But when bugzilla version 2.22.1 (version
> in Debian etch) is passed from the .hg/hgrc config it throws an exception
> implying that there were database schema changes that will prevent this hook
> from working.
> In fact the database schema did not change in any way that affects this hook.
>

Please avoid lines > 80 chars

> diff -r 9189ae05467d -r 50de1188eb92 hgext/bugzilla.py
> --- a/hgext/bugzilla.py Sun Sep 30 16:38:42 2007 +0200
> +++ b/hgext/bugzilla.py Tue Oct 02 14:31:19 2007 +0100
> @@ -186,11 +186,18 @@ class bugzilla_2_16(object):
>                      values (%s, %s, %s, %s)''',
>                   (bugid, userid, now, self.longdesc_id))
>
> +class bugzilla_2_22_1(bugzilla_2_16):
> +    '''support for bugzilla version 2.22.1. Just extends bugzilla_2_16 there were no bugzilla database schema changes that affect this hook.'''

80 chars
> +
> +    def __init__(self, ui):
> +        bugzilla_2_16.__init__(self, ui)
> +
>  class bugzilla(object):
>      # supported versions of bugzilla. different versions have
>      # different schemas.
>      _versions = {
>          '2.16': bugzilla_2_16,
> +        '2.22.1': bugzilla_2_22_1,

why not just:
+        '2.22.1': bugzilla_2_16,
with a comment to say that the schema didn't change.

Thanks,

Benoit


More information about the Mercurial-devel mailing list