Bug 976892 - Update mach mercurial-setup to use qimportbz from it's new home in version-control-tools; r=gps
authorEd Morley <emorley@mozilla.com>
Wed, 26 Feb 2014 17:28:09 +0000
changeset 171044 e0869c89abac3ea05d03674f27e6fcc27b387722
parent 171043 b76b7480537253c860b6289d5c8a9ef1d1c0e1dd
child 171045 fb4422a671dcd248a4a0d326143b96e2ff25dc9c
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersgps
bugs976892
milestone30.0a1
Bug 976892 - Update mach mercurial-setup to use qimportbz from it's new home in version-control-tools; r=gps qimportbz is now pulled from its new canonical home. The old location can be cleaned if the user agrees to it. The new location is updated in the hgrc. DONTBUILD (NPOTB)
tools/mercurial/hgsetup/wizard.py
--- a/tools/mercurial/hgsetup/wizard.py
+++ b/tools/mercurial/hgsetup/wizard.py
@@ -60,17 +60,17 @@ https://hg.mozilla.org/hgcustom/version-
 MQEXT_INFO = '''
 The mqext extension (https://bitbucket.org/sfink/mqext) provides a number of
 useful abilities to Mercurial, including automatically committing changes to
 your mq patch queue.
 '''.strip()
 
 QIMPORTBZ_INFO = '''
 The qimportbz extension
-(https://hg.mozilla.org/users/robarnold_cmu.edu/qimportbz) makes it possible to
+(https://hg.mozilla.org/hgcustom/version-control-tools/file/default/hgext/qimportbz/README) makes it possible to
 import patches from Bugzilla using a friendly bz:// URL handler. e.g.
 |hg qimport bz://123456|.
 '''.strip()
 
 QNEWCURRENTUSER_INFO = '''
 The mercurial queues command |hg qnew|, which creates new patches in your patch
 queue does not set patch author information by default. Author information
 should be included when uploading for review.
@@ -201,33 +201,28 @@ class MercurialSetupWizard(object):
             if update_mqext:
                 self.update_mercurial_repo(
                 hg,
                 'https://bitbucket.org/sfink/mqext',
                 os.path.join(self.ext_dir, 'mqext'),
                 'default',
                 'Ensuring mqext extension is up to date...')
 
-            update_qimportbz = 'qimportbz' in active
+            activate_qimportbz = True
             if 'qimportbz' not in active:
                 print(QIMPORTBZ_INFO)
-                if self._prompt_yn('Would you like to activate qimportbz'):
-                    update_qimportbz = True
-                    c.activate_extension('qimportbz',
-                        os.path.join(self.ext_dir, 'qimportbz'))
-                    print('Activated qimportbz extension.')
-                    print('')
+                if not self._prompt_yn('Would you like to activate qimportbz'):
+                    activate_qimportbz = False
 
-            if update_qimportbz:
-                self.update_mercurial_repo(
-                    hg,
-                    'https://hg.mozilla.org/users/robarnold_cmu.edu/qimportbz',
-                    os.path.join(self.ext_dir, 'qimportbz'),
-                    'default',
-                    'Ensuring qimportbz extension is up to date...')
+            if activate_qimportbz:
+                update_vcs_tools = True
+                c.activate_extension('qimportbz',
+                    os.path.join(self.vcs_tools_dir, 'hgext', 'qimportbz'))
+                print('Activated qimportbz extension.')
+                print('')
 
             if not c.have_qnew_currentuser_default():
                 print(QNEWCURRENTUSER_INFO)
                 if self._prompt_yn('Would you like qnew to set patch author by '
                                    'default'):
                     c.ensure_qnew_currentuser_default()
                     print('Configured qnew to set patch author by default.')
                     print('')
@@ -236,17 +231,17 @@ class MercurialSetupWizard(object):
             self.update_mercurial_repo(
                 hg,
                 'https://hg.mozilla.org/hgcustom/version-control-tools',
                 self.vcs_tools_dir,
                 'default',
                 'Ensuring version-control-tools is up to date...')
 
         # Look for and clean up old extensions.
-        for ext in {'bzexport',}:
+        for ext in {'bzexport', 'qimportbz'}:
             path = os.path.join(self.ext_dir, ext)
             if os.path.exists(path):
                 if self._prompt_yn('Would you like to remove the old and no '
                     'longer referenced repository at %s' % path):
                     print('Cleaning up old repository: %s' % path)
                     shutil.rmtree(path)
 
         c.add_mozilla_host_fingerprints()