bugzilla.py
changeset 4 83eace28a7c2
parent 2 afc063529895
child 6 bb7c01182512
     1.1 --- a/bugzilla.py	Fri Dec 11 17:23:05 2009 -0600
     1.2 +++ b/bugzilla.py	Fri Dec 11 17:25:09 2009 -0600
     1.3 @@ -21,65 +21,86 @@
     1.4  be run by Mercurial as the user pushing the change; you will need to
     1.5  ensure the Bugzilla install file permissions are set appropriately.
     1.6  
     1.7 -Configuring the extension:
     1.8 +The extension is configured through three different configuration
     1.9 +sections. These keys are recognized in the [bugzilla] section:
    1.10 +
    1.11 +host
    1.12 +  Hostname of the MySQL server holding the Bugzilla database.
    1.13 +
    1.14 +db
    1.15 +  Name of the Bugzilla database in MySQL. Default 'bugs'.
    1.16 +
    1.17 +user
    1.18 +  Username to use to access MySQL server. Default 'bugs'.
    1.19 +
    1.20 +password
    1.21 +  Password to use to access MySQL server.
    1.22 +
    1.23 +timeout
    1.24 +  Database connection timeout (seconds). Default 5.
    1.25  
    1.26 -    [bugzilla]
    1.27 +version
    1.28 +  Bugzilla version. Specify '3.0' for Bugzilla versions 3.0 and later,
    1.29 +  '2.18' for Bugzilla versions from 2.18 and '2.16' for versions prior
    1.30 +  to 2.18.
    1.31 +
    1.32 +bzuser
    1.33 +  Fallback Bugzilla user name to record comments with, if changeset
    1.34 +  committer cannot be found as a Bugzilla user.
    1.35 +
    1.36 +bzdir
    1.37 +   Bugzilla install directory. Used by default notify. Default
    1.38 +   '/var/www/html/bugzilla'.
    1.39 +
    1.40 +notify
    1.41 +  The command to run to get Bugzilla to send bug change notification
    1.42 +  emails. Substitutes from a map with 3 keys, 'bzdir', 'id' (bug id)
    1.43 +  and 'user' (committer bugzilla email). Default depends on version;
    1.44 +  from 2.18 it is "cd %(bzdir)s && perl -T contrib/sendbugmail.pl
    1.45 +  %(id)s %(user)s".
    1.46  
    1.47 -    host       Hostname of the MySQL server holding the Bugzilla
    1.48 -               database.
    1.49 -    db         Name of the Bugzilla database in MySQL. Default 'bugs'.
    1.50 -    user       Username to use to access MySQL server. Default 'bugs'.
    1.51 -    password   Password to use to access MySQL server.
    1.52 -    timeout    Database connection timeout (seconds). Default 5.
    1.53 -    version    Bugzilla version. Specify '3.0' for Bugzilla versions
    1.54 -               3.0 and later, '2.18' for Bugzilla versions from 2.18
    1.55 -               and '2.16' for versions prior to 2.18.
    1.56 -    bzuser     Fallback Bugzilla user name to record comments with, if
    1.57 -               changeset committer cannot be found as a Bugzilla user.
    1.58 -    bzdir      Bugzilla install directory. Used by default notify.
    1.59 -               Default '/var/www/html/bugzilla'.
    1.60 -    notify     The command to run to get Bugzilla to send bug change
    1.61 -               notification emails. Substitutes from a map with 3
    1.62 -               keys, 'bzdir', 'id' (bug id) and 'user' (committer
    1.63 -               bugzilla email). Default depends on version; from 2.18
    1.64 -               it is "cd %(bzdir)s && perl -T contrib/sendbugmail.pl
    1.65 -               %(id)s %(user)s".
    1.66 -    regexp     Regular expression to match bug IDs in changeset commit
    1.67 -               message. Must contain one "()" group. The default
    1.68 -               expression matches 'Bug 1234', 'Bug no. 1234', 'Bug
    1.69 -               number 1234', 'Bugs 1234,5678', 'Bug 1234 and 5678' and
    1.70 -               variations thereof. Matching is case insensitive.
    1.71 -    style      The style file to use when formatting comments.
    1.72 -    template   Template to use when formatting comments. Overrides
    1.73 -               style if specified. In addition to the usual Mercurial
    1.74 -               keywords, the extension specifies:
    1.75 -                   {bug}       The Bugzilla bug ID.
    1.76 -                   {root}      The full pathname of the Mercurial
    1.77 -                               repository.
    1.78 -                   {webroot}   Stripped pathname of the Mercurial
    1.79 -                               repository.
    1.80 -                   {hgweb}     Base URL for browsing Mercurial
    1.81 -                               repositories.
    1.82 -               Default 'changeset {node|short} in repo {root} refers '
    1.83 -                       'to bug {bug}.\\ndetails:\\n\\t{desc|tabindent}'
    1.84 -    strip      The number of slashes to strip from the front of {root}
    1.85 -               to produce {webroot}. Default 0.
    1.86 -    usermap    Path of file containing Mercurial committer ID to
    1.87 -               Bugzilla user ID mappings. If specified, the file
    1.88 -               should contain one mapping per line,
    1.89 -               "committer"="Bugzilla user". See also the [usermap]
    1.90 -               section.
    1.91 +regexp
    1.92 +  Regular expression to match bug IDs in changeset commit message.
    1.93 +  Must contain one "()" group. The default expression matches 'Bug
    1.94 +  1234', 'Bug no. 1234', 'Bug number 1234', 'Bugs 1234,5678', 'Bug
    1.95 +  1234 and 5678' and variations thereof. Matching is case insensitive.
    1.96 +
    1.97 +style
    1.98 +  The style file to use when formatting comments.
    1.99 +
   1.100 +template
   1.101 +  Template to use when formatting comments. Overrides style if
   1.102 +  specified. In addition to the usual Mercurial keywords, the
   1.103 +  extension specifies::
   1.104 +
   1.105 +    {bug}       The Bugzilla bug ID.
   1.106 +    {root}      The full pathname of the Mercurial repository.
   1.107 +    {webroot}   Stripped pathname of the Mercurial repository.
   1.108 +    {hgweb}     Base URL for browsing Mercurial repositories.
   1.109  
   1.110 -    [usermap]
   1.111 -    Any entries in this section specify mappings of Mercurial
   1.112 -    committer ID to Bugzilla user ID. See also [bugzilla].usermap.
   1.113 -    "committer"="Bugzilla user"
   1.114 +  Default 'changeset {node|short} in repo {root} refers '
   1.115 +          'to bug {bug}.\\ndetails:\\n\\t{desc|tabindent}'
   1.116 +
   1.117 +strip
   1.118 +  The number of slashes to strip from the front of {root} to produce
   1.119 +  {webroot}. Default 0.
   1.120 +
   1.121 +usermap
   1.122 +  Path of file containing Mercurial committer ID to Bugzilla user ID
   1.123 +  mappings. If specified, the file should contain one mapping per
   1.124 +  line, "committer"="Bugzilla user". See also the [usermap] section.
   1.125  
   1.126 -    [web]
   1.127 -    baseurl    Base URL for browsing Mercurial repositories. Reference
   1.128 -               from templates as {hgweb}.
   1.129 +The [usermap] section is used to specify mappings of Mercurial
   1.130 +committer ID to Bugzilla user ID. See also [bugzilla].usermap.
   1.131 +"committer"="Bugzilla user"
   1.132 +
   1.133 +Finally, the [web] section supports one entry:
   1.134  
   1.135 -Activating the extension:
   1.136 +baseurl
   1.137 +  Base URL for browsing Mercurial repositories. Reference from
   1.138 +  templates as {hgweb}.
   1.139 +
   1.140 +Activating the extension::
   1.141  
   1.142      [extensions]
   1.143      hgext.bugzilla =
   1.144 @@ -92,7 +113,7 @@
   1.145  
   1.146  This example configuration is for a collection of Mercurial
   1.147  repositories in /var/local/hg/repos/ used with a local Bugzilla 3.2
   1.148 -installation in /opt/bugzilla-3.2.
   1.149 +installation in /opt/bugzilla-3.2. ::
   1.150  
   1.151      [bugzilla]
   1.152      host=localhost
   1.153 @@ -100,7 +121,9 @@
   1.154      version=3.0
   1.155      [email protected]
   1.156      bzdir=/opt/bugzilla-3.2
   1.157 -    template=Changeset {node|short} in {root|basename}.\\n{hgweb}/{webroot}/rev/{node|short}\\n\\n{desc}\\n
   1.158 +    template=Changeset {node|short} in {root|basename}.
   1.159 +             {hgweb}/{webroot}/rev/{node|short}\\n
   1.160 +             {desc}\\n
   1.161      strip=5
   1.162  
   1.163      [web]
   1.164 @@ -109,7 +132,7 @@
   1.165      [usermap]
   1.166      [email protected][email protected]
   1.167  
   1.168 -Commits add a comment to the Bugzilla bug record of the form:
   1.169 +Commits add a comment to the Bugzilla bug record of the form::
   1.170  
   1.171      Changeset 3b16791d6642 in repository-name.
   1.172      http://dev.domain.com/hg/repository-name/rev/3b16791d6642