Bug 1275105 - Remove references to MQ from `mach mercurial-setup`; r?smacleod
MQ isn't recommended for modern Mercurial development. Stop advertising
it.
MozReview-Commit-ID: IOx3A5ZeJnJ
--- a/tools/mercurial/hgsetup/config.py
+++ b/tools/mercurial/hgsetup/config.py
@@ -148,53 +148,16 @@ class MercurialConfig(object):
if 'diff' not in self._c:
self._c['diff'] = {}
d = self._c['diff']
d['git'] = 1
d['showfunc'] = 1
d['unified'] = 8
- def have_mqext_autocommit_mq(self):
- if 'mqext' not in self._c:
- return False
- v = self._c['mqext'].get('mqcommit')
- return v == 'auto' or v == 'yes'
-
- def ensure_mqext_autocommit_mq(self):
- if self.have_mqext_autocommit_mq():
- return
- if 'mqext' not in self._c:
- self._c['mqext'] = {}
- self._c['mqext']['mqcommit'] = 'auto'
-
- 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:
- if arg == '--currentuser' or re.match("-[^-]*U.*", arg):
- return True
- return False
-
- 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'
- else:
- d['qnew'] = '-U ' + d['qnew']
-
def get_bugzilla_credentials(self):
if 'bugzilla' not in self._c:
return None, None, None, None, None
b = self._c['bugzilla']
return (
b.get('username', None),
b.get('password', None),
--- a/tools/mercurial/hgsetup/wizard.py
+++ b/tools/mercurial/hgsetup/wizard.py
@@ -62,66 +62,27 @@ aren't comfortable giving us your full n
BAD_DIFF_SETTINGS = '''
Mozilla developers produce patches in a standard format, but your Mercurial is
not configured to produce patches in that format.
(Relevant config options: diff.git, diff.showfunc, diff.unified)
'''.strip()
-MQ_INFO = '''
-The mq extension manages patches as separate files. It provides an
-alternative to the recommended bookmark-based development workflow.
-
-If you are a newcomer to Mercurial or are coming from Git, it is
-recommended to avoid mq.
-
-(Relevant config option: extensions.mq)
-
-Would you like to activate the mq extension
-'''.strip()
-
BZEXPORT_INFO = '''
If you plan on uploading patches to Mozilla, there is an extension called
bzexport that makes it easy to upload patches from the command line via the
|hg bzexport| command. More info is available at
https://hg.mozilla.org/hgcustom/version-control-tools/file/default/hgext/bzexport/README
(Relevant config option: extensions.bzexport)
Would you like to activate bzexport
'''.strip()
-MQEXT_INFO = '''
-The mqext extension adds a number of features, including automatically committing
-changes to your mq patch queue. More info is available at
-https://hg.mozilla.org/hgcustom/version-control-tools/file/default/hgext/mqext/README.txt
-
-(Relevant config option: extensions.mqext)
-
-Would you like to activate mqext
-'''.strip()
-
-QIMPORTBZ_INFO = '''
-The qimportbz extension
-(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|.
-
-(Relevant config option: extensions.qimportbz)
-
-Would you like to activate qimportbz
-'''.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.
-'''.strip()
-
FINISHED = '''
Your Mercurial should now be properly configured and recommended extensions
should be up to date!
'''.strip()
REVIEWBOARD_MINIMUM_VERSION = LooseVersion('3.3')
REVIEWBOARD_INCOMPATIBLE = '''
@@ -407,18 +368,16 @@ class MercurialSetupWizard(object):
ext_path = os.path.join(self.updater.hgwatchman_dir,
'hgwatchman')
if self.can_use_extension(c, 'hgwatchman', ext_path):
c.activate_extension('hgwatchman', ext_path)
except subprocess.CalledProcessError as e:
print('Error compiling hgwatchman; will not install hgwatchman')
print(e.output)
- self.prompt_native_extension(c, 'mq', MQ_INFO)
-
if 'reviewboard' not in c.extensions:
if hg_version < REVIEWBOARD_MINIMUM_VERSION:
print(REVIEWBOARD_INCOMPATIBLE % REVIEWBOARD_MINIMUM_VERSION)
else:
p = os.path.join(self.vcs_tools_dir, 'hgext', 'reviewboard',
'client.py')
self.prompt_external_extension(c, 'reviewboard',
'Would you like to enable the reviewboard extension so '
@@ -445,35 +404,16 @@ class MercurialSetupWizard(object):
if hg_version >= PUSHTOTRY_MINIMUM_VERSION:
self.prompt_external_extension(c, 'push-to-try', PUSHTOTRY_INFO)
if not c.have_wip():
if self._prompt_yn(WIP_INFO):
c.install_wip_alias()
- if 'mq' in c.extensions:
- self.prompt_external_extension(c, 'mqext', MQEXT_INFO)
-
- if 'mqext' in c.extensions and not c.have_mqext_autocommit_mq():
- if self._prompt_yn('Would you like to configure mqext to '
- 'automatically commit changes as you modify patches'):
- c.ensure_mqext_autocommit_mq()
- print('Configured mqext to auto-commit.\n')
-
- self.prompt_external_extension(c, 'qimportbz', QIMPORTBZ_INFO)
-
- 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('')
-
if 'reviewboard' in c.extensions or 'bzpost' in c.extensions:
bzuser, bzpass, bzuserid, bzcookie, bzapikey = c.get_bugzilla_credentials()
if not bzuser or not bzapikey:
print(MISSING_BUGZILLA_CREDENTIALS)
if not bzuser:
bzuser = self._prompt('What is your Bugzilla email address? (optional)',