Mercurial > hg-stable
comparison hgext/mq.py @ 34193:62490b84ebf8
configitems: register the 'mq.git' config
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Fri, 30 Jun 2017 03:43:14 +0200 |
parents | 0f9936d80e01 |
children | cac8c4e51951 |
comparison
equal
deleted
inserted
replaced
34192:37513324f620 | 34193:62490b84ebf8 |
---|---|
106 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for | 106 # Note for extension authors: ONLY specify testedwith = 'ships-with-hg-core' for |
107 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should | 107 # extensions which SHIP WITH MERCURIAL. Non-mainline extensions should |
108 # be specifying the version(s) of Mercurial they are tested with, or | 108 # be specifying the version(s) of Mercurial they are tested with, or |
109 # leave the attribute unspecified. | 109 # leave the attribute unspecified. |
110 testedwith = 'ships-with-hg-core' | 110 testedwith = 'ships-with-hg-core' |
111 | |
112 configtable = {} | |
113 configitem = registrar.configitem(configtable) | |
114 | |
115 configitem('mq', 'git', | |
116 default='auto', | |
117 ) | |
111 | 118 |
112 # force load strip extension formerly included in mq and import some utility | 119 # force load strip extension formerly included in mq and import some utility |
113 try: | 120 try: |
114 stripext = extensions.find('strip') | 121 stripext = extensions.find('strip') |
115 except KeyError: | 122 except KeyError: |
442 self.statuspath = "status" | 449 self.statuspath = "status" |
443 self.guardspath = "guards" | 450 self.guardspath = "guards" |
444 self.activeguards = None | 451 self.activeguards = None |
445 self.guardsdirty = False | 452 self.guardsdirty = False |
446 # Handle mq.git as a bool with extended values | 453 # Handle mq.git as a bool with extended values |
447 try: | 454 gitmode = ui.config('mq', 'git').lower() |
448 gitmode = ui.configbool('mq', 'git', None) | 455 boolmode = util.parsebool(gitmode) |
449 if gitmode is None: | 456 if boolmode is not None: |
450 raise error.ConfigError | 457 if boolmode: |
451 if gitmode: | 458 gitmode = 'yes' |
452 self.gitmode = 'yes' | |
453 else: | 459 else: |
454 self.gitmode = 'no' | 460 gitmode = 'no' |
455 except error.ConfigError: | 461 self.gitmode = gitmode |
456 # let's have check-config ignore the type mismatch | |
457 self.gitmode = ui.config(r'mq', 'git', 'auto').lower() | |
458 # deprecated config: mq.plain | 462 # deprecated config: mq.plain |
459 self.plainmode = ui.configbool('mq', 'plain', False) | 463 self.plainmode = ui.configbool('mq', 'plain', False) |
460 self.checkapplied = True | 464 self.checkapplied = True |
461 | 465 |
462 @util.propertycache | 466 @util.propertycache |