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
--- 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}.')