Bug 977384 - mach mercurial-setup: Remaining cleanup; r=gps
authorEd Morley <emorley@mozilla.com>
Thu, 27 Feb 2014 10:10:22 +0000
changeset 171266 5fae30b6968ffc1041ab114103c9f1e6889b1de8
parent 171265 903893620b9f726bf12a2ea7cdeb9ef690a31a08
child 171267 835210e4384c8db549f932dd869589d657bad3e9
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersgps
bugs977384
milestone30.0a1
Bug 977384 - mach mercurial-setup: Remaining cleanup; r=gps
tools/mercurial/hgsetup/config.py
tools/mercurial/hgsetup/wizard.py
--- a/tools/mercurial/hgsetup/config.py
+++ b/tools/mercurial/hgsetup/config.py
@@ -128,17 +128,16 @@ class MercurialConfig(object):
         if value:
             self._c['mqext']['mqcommit'] = 'auto'
         else:
             try:
                 del self._c['mqext']['mqcommit']
             except KeyError:
                 pass
 
-
     def have_qnew_currentuser_default(self):
         if 'defaults' not in self._c:
             return False
         d = self._c['defaults']
         if 'qnew' not in d:
             return False
         argv = d['qnew'].split(' ')
         for arg in argv:
@@ -149,13 +148,11 @@ class MercurialConfig(object):
     def ensure_qnew_currentuser_default(self):
         if self.have_qnew_currentuser_default():
             return
         if 'defaults' not in self._c:
             self._c['defaults'] = {}
 
         d = self._c['defaults']
         if 'qnew' not in d:
-          d['qnew'] = '-U'
+            d['qnew'] = '-U'
         else:
-          d['qnew'] = '-U ' + d['qnew']
-
-
+            d['qnew'] = '-U ' + d['qnew']
--- a/tools/mercurial/hgsetup/wizard.py
+++ b/tools/mercurial/hgsetup/wizard.py
@@ -151,29 +151,27 @@ class MercurialSetupWizard(object):
             'Would you like to enable the rebase extension to allow you to move'
             ' changesets around (which can help maintain a linear history)')
 
         self.prompt_native_extension(c, 'mq',
             'Would you like to activate the mq extension to manage patches')
 
         self.prompt_external_extension(c, 'bzexport', BZEXPORT_INFO)
 
-        active = c.extensions
-
-        if 'mq' in active:
+        if 'mq' in c.extensions:
             self.prompt_external_extension(c, 'mqext', MQEXT_INFO,
                                            os.path.join(self.ext_dir, 'mqext'))
 
             if 'mqext' in c.extensions:
                 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...')
+                    hg,
+                    'https://bitbucket.org/sfink/mqext',
+                    os.path.join(self.ext_dir, 'mqext'),
+                    'default',
+                    'Ensuring mqext extension is up to date...')
                 if self._prompt_yn('Would you like to configure mqext to '
                     'automatically commit changes as you modify patches'):
                     c.autocommit_mq(True)
                     print('Configured mqext to auto-commit.\n')
 
             self.prompt_external_extension(c, 'qimportbz', QIMPORTBZ_INFO)
 
             if not c.have_qnew_currentuser_default():
@@ -300,9 +298,9 @@ class MercurialSetupWizard(object):
                 return True
 
             if choice in ('y', 'yes'):
                 return True
 
             if choice in ('n', 'no'):
                 return False
 
-            print('Must reply with one of {yes, no, y, no}.')
+            print('Must reply with one of {yes, no, y, n}.')