add hggit as a global option

Add a config item '[confman] hggit' for changing the default value of the 'hggit' command flag.
3 files changed, 18 insertions(+), 3 deletions(-)

M hgext3rd/confman/__init__.py
M hgext3rd/confman/configuration.py
M hgext3rd/confman/opts.py
M hgext3rd/confman/__init__.py +8 -0
@@ 13,6 13,14 @@ from .meta import colortable
 from .commands import *
 
 
+configtable = {}
+configitem = registrar.configitem(configtable)
+
+configitem(b'confman', b'hggit',
+           default=True,
+)
+
+
 def extsetup(ui):
     """ add confman support to hgview """
     try:

          
M hgext3rd/confman/configuration.py +9 -2
@@ 52,6 52,13 @@ class configurationmanager(object):
 
         self._readconf()
 
+    @property
+    def hggit(self):
+        value = self.opts.get('hggit')
+        if value is not None:
+            return value
+        return self.ui.configbool(b'confman', b'hggit')
+
     def _readconf(self):
         "Load configuration from <root>/.hgconf"
         from .utils import oconfig

          
@@ 90,7 97,7 @@ class configurationmanager(object):
             return None
         try:
             return repoclassbyconf(
-                self.confs[section], path, self.opts.get('hggit')
+                self.confs[section], path, self.hggit,
             )(self, path)
         except error.RepoError:
             return None

          
@@ 180,7 187,7 @@ class configurationmanager(object):
             try:
                 path = self.pathfromsection(section)
                 repoclassbyconf(
-                    conf, path, self.opts.get('hggit')
+                    conf, path, self.hggit
                 ).clone(
                     self, source, dest, self.confs[section]
                 )

          
M hgext3rd/confman/opts.py +1 -1
@@ 6,7 6,7 @@ PULLURIOPT = ('p', 'use-hgrc-path', '',
               'distant repository path name registered into hgrc.paths.*')
 URIMAPOPT = ('', 'uri-map-file', '', 'specify uri map file')
 HTTPSOPT = ('', 'insecure', False, 'work around self bad certificates')
-HGGITOPT = ('', 'hggit', True, 'git: operate with hg-git')
+HGGITOPT = ('', 'hggit', None, 'git: operate with hg-git')
 
 
 DEFAULTOPTS = [INCLUDEOPT, EXCLUDEOPT, ROOTPATHOPT, HGGITOPT]