mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-03 20:49:27 +00:00
Bug 977961 - mach mercurial-setup: Avoid prompting to enable mqext auto-commit when already enabled; r=gps
DONTBUILD (NPOTB)
This commit is contained in:
parent
29f215877a
commit
575e4b2042
@ -121,17 +121,18 @@ class MercurialConfig(object):
|
||||
d['showfunc'] = 1
|
||||
d['unified'] = 8
|
||||
|
||||
def autocommit_mq(self, value=True):
|
||||
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'] = {}
|
||||
|
||||
if value:
|
||||
self._c['mqext']['mqcommit'] = 'auto'
|
||||
else:
|
||||
try:
|
||||
del self._c['mqext']['mqcommit']
|
||||
except KeyError:
|
||||
pass
|
||||
self._c['mqext']['mqcommit'] = 'auto'
|
||||
|
||||
def have_qnew_currentuser_default(self):
|
||||
if 'defaults' not in self._c:
|
||||
|
@ -169,9 +169,11 @@ class MercurialSetupWizard(object):
|
||||
os.path.join(self.ext_dir, 'mqext'),
|
||||
'default',
|
||||
'Ensuring mqext extension is up to date...')
|
||||
|
||||
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.autocommit_mq(True)
|
||||
c.ensure_mqext_autocommit_mq()
|
||||
print('Configured mqext to auto-commit.\n')
|
||||
|
||||
self.prompt_external_extension(c, 'qimportbz', QIMPORTBZ_INFO)
|
||||
|
Loading…
x
Reference in New Issue
Block a user