configwizard: remove some unused code from wizard.py (bug 1277406); r=glob draft
authorGregory Szorc <gps@mozilla.com>
Wed, 01 Jun 2016 16:33:27 -0700
changeset 8507 ffb38f765f7087fa32b60ae047e6670da98c54b5
parent 8506 fa342d0d8b1de9a080f3d7bef69403648552f623
child 8508 1c9d915ff877c141051ce30a639887dd66a69ac7
push id918
push userbmo:gps@mozilla.com
push dateThu, 09 Jun 2016 19:23:31 +0000
reviewersglob
bugs1277406
configwizard: remove some unused code from wizard.py (bug 1277406); r=glob It is only adding noise at this point. Let's nuke it. MozReview-Commit-ID: DVS8xZgG4yu
hgext/configwizard/hgsetup/wizard.py
--- a/hgext/configwizard/hgsetup/wizard.py
+++ b/hgext/configwizard/hgsetup/wizard.py
@@ -92,70 +92,8 @@ class MercurialSetupWizard(object):
             seen_vct.add(os.path.realpath(os.path.expanduser(vct)))
 
         if len(seen_vct) > 1:
             print(MULTIPLE_VCT % c.config_path)
 
         print(FINISHED)
         return 0
 
-    def can_use_extension(self, c, name, path=None):
-        # Load extension to hg and search stdout for printed exceptions
-        if not path:
-            path = os.path.join(self.vcs_tools_dir, 'hgext', name)
-        result = subprocess.check_output(['hg',
-             '--config', 'extensions.testmodule=%s' % path,
-             '--config', 'ui.traceback=true'],
-            stderr=subprocess.STDOUT)
-        return b"Traceback" not in result
-
-    def prompt_external_extension(self, c, name, prompt_text, path=None):
-        # Ask the user if the specified extension should be enabled. Defaults
-        # to treating the extension as one in version-control-tools/hgext/
-        # in a directory with the same name as the extension and thus also
-        # flagging the version-control-tools repo as needing an update.
-        if name not in c.extensions:
-            if not self.can_use_extension(c, name, path):
-                return
-            print(name)
-            print('=' * len(name))
-            print('')
-            if not self._prompt_yn(prompt_text):
-                print('')
-                return
-        if not path:
-            # We replace the user's home directory with ~ so the
-            # config file doesn't depend on the path to the home
-            # directory
-            path = os.path.join(self.vcs_tools_dir.replace(os.path.expanduser('~'), '~'), 'hgext', name)
-        c.activate_extension(name, path)
-        print('Activated %s extension.\n' % name)
-
-    def _prompt(self, msg, allow_empty=False):
-        print(msg)
-
-        while True:
-            response = raw_input().decode('utf-8')
-
-            if response:
-                return response
-
-            if allow_empty:
-                return None
-
-            print('You must type something!')
-
-    def _prompt_yn(self, msg):
-        print('%s? [Y/n]' % msg)
-
-        while True:
-            choice = raw_input().lower().strip()
-
-            if not choice:
-                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, n}.')