diff hgext/eol.py @ 20790:49f2d5644f04

config: set a 'source' in most cases where config don't come from file but code Some extensions set configuration settings that showed up in 'hg showconfig --debug' with 'none' as source. That was confusing. Instead, they will now tell which extension they come from. This change tries to be consistent and specify a source everywhere - also where it perhaps is less relevant.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 19 Mar 2014 02:45:14 +0100
parents de16c673455b
children 6500a2eebee8
line wrap: on
line diff
--- a/hgext/eol.py	Wed Mar 19 02:45:14 2014 +0100
+++ b/hgext/eol.py	Wed Mar 19 02:45:14 2014 +0100
@@ -151,7 +151,7 @@
         self.cfg = config.config()
         # Our files should not be touched. The pattern must be
         # inserted first override a '** = native' pattern.
-        self.cfg.set('patterns', '.hg*', 'BIN')
+        self.cfg.set('patterns', '.hg*', 'BIN', 'eol')
         # We can then parse the user's patterns.
         self.cfg.parse('.hgeol', data)
 
@@ -176,14 +176,14 @@
         for pattern, style in self.cfg.items('patterns'):
             key = style.upper()
             try:
-                ui.setconfig('decode', pattern, self._decode[key])
-                ui.setconfig('encode', pattern, self._encode[key])
+                ui.setconfig('decode', pattern, self._decode[key], 'eol')
+                ui.setconfig('encode', pattern, self._encode[key], 'eol')
             except KeyError:
                 ui.warn(_("ignoring unknown EOL style '%s' from %s\n")
                         % (style, self.cfg.source('patterns', pattern)))
         # eol.only-consistent can be specified in ~/.hgrc or .hgeol
         for k, v in self.cfg.items('eol'):
-            ui.setconfig('eol', k, v)
+            ui.setconfig('eol', k, v, 'eol')
 
     def checkrev(self, repo, ctx, files):
         failed = []
@@ -261,7 +261,7 @@
     return False
 
 def uisetup(ui):
-    ui.setconfig('hooks', 'preupdate.eol', preupdate)
+    ui.setconfig('hooks', 'preupdate.eol', preupdate, 'eol')
 
 def extsetup(ui):
     try:
@@ -280,7 +280,7 @@
     for name, fn in filters.iteritems():
         repo.adddatafilter(name, fn)
 
-    ui.setconfig('patch', 'eol', 'auto')
+    ui.setconfig('patch', 'eol', 'auto', 'eol')
 
     class eolrepo(repo.__class__):