Mercurial > hg
comparison hgext/mq.py @ 31460:03d99d08147b
mq: get rid of ui.backupconfig
author | Jun Wu <quark@fb.com> |
---|---|
date | Thu, 16 Mar 2017 14:39:18 -0700 |
parents | 6e1c79578e5c |
children | 448acdee9161 |
comparison
equal
deleted
inserted
replaced
31459:f84fbd27b6d3 | 31460:03d99d08147b |
---|---|
403 """ | 403 """ |
404 repo = repo.unfiltered() | 404 repo = repo.unfiltered() |
405 if phase is None: | 405 if phase is None: |
406 if repo.ui.configbool('mq', 'secret', False): | 406 if repo.ui.configbool('mq', 'secret', False): |
407 phase = phases.secret | 407 phase = phases.secret |
408 overrides = {('ui', 'allowemptycommit'): True} | |
408 if phase is not None: | 409 if phase is not None: |
409 phasebackup = repo.ui.backupconfig('phases', 'new-commit') | 410 overrides[('phases', 'new-commit')] = phase |
410 allowemptybackup = repo.ui.backupconfig('ui', 'allowemptycommit') | 411 with repo.ui.configoverride(overrides, 'mq'): |
411 try: | |
412 if phase is not None: | |
413 repo.ui.setconfig('phases', 'new-commit', phase, 'mq') | |
414 repo.ui.setconfig('ui', 'allowemptycommit', True) | 412 repo.ui.setconfig('ui', 'allowemptycommit', True) |
415 return repo.commit(*args, **kwargs) | 413 return repo.commit(*args, **kwargs) |
416 finally: | |
417 repo.ui.restoreconfig(allowemptybackup) | |
418 if phase is not None: | |
419 repo.ui.restoreconfig(phasebackup) | |
420 | 414 |
421 class AbortNoCleanup(error.Abort): | 415 class AbortNoCleanup(error.Abort): |
422 pass | 416 pass |
423 | 417 |
424 class queue(object): | 418 class queue(object): |