Preliminary bugzilla integration via code in bzexport
authorGregory Szorc <gps@mozilla.com>
Wed, 24 Jul 2013 11:26:54 -0700
changeset 28 3c428bc6f5be55af6e6dfe5836a96e0999e65045
parent 27 3bf72073a4402f673da255c0461821c4aceb949c
child 29 3f702b69b06c1a9054aa09af8464481234715171
push id14
push usergszorc@mozilla.com
push dateThu, 25 Jul 2013 18:47:14 +0000
Preliminary bugzilla integration via code in bzexport
__init__.py
--- a/__init__.py
+++ b/__init__.py
@@ -106,27 +106,32 @@ from mercurial.localrepo import (
 )
 from mercurial.node import (
     hex,
 )
 from mercurial import (
     cmdutil,
     demandimport,
     encoding,
+    extensions,
     hg,
     util,
 )
 
 from mozautomation.repository import (
     MercurialRepository,
     resolve_trees_to_official,
     resolve_trees_to_uris,
     resolve_uri_to_tree,
 )
 
+import bzauth
+import bz
+
+bz_available = False
 
 commands.norepo += ' cloneunified moztrees treestatus'
 cmdtable = {}
 command = cmdutil.command(cmdtable)
 
 colortable = {
     'buildstatus.success': 'green',
     'buildstatus.failed': 'red',
@@ -386,16 +391,25 @@ class remoterefs(dict):
 
     def write(self):
         f = self._repo.vfs('remoterefs', 'w', atomictemp=True)
         for ref in sorted(self):
             f.write('%s %s\n' % (hex(self[ref]), encoding.fromlocal(ref)))
         f.close()
 
 
+def extsetup(ui):
+    global bz_available
+    try:
+        extensions.find('bzexport')
+        bz_available = True
+    except KeyError:
+        pass
+
+
 def reposetup(ui, repo):
     """Custom repository implementation.
 
     Our custom repository class tracks remote tree references so users can
     reference specific revisions on remotes.
     """
 
     if not repo.local():