# HG changeset patch # User Pierre-Yves David # Date 1498786044 -7200 # Node ID 54bc88c56ec87da0af0b6adfd3ab439d6eacafeb # Parent 2b233065f57a38ff948611ff175f2d297729b9a9 configitems: register the 'automv.similarity' config Default value has been ported. diff -r 2b233065f57a -r 54bc88c56ec8 hgext/automv.py --- a/hgext/automv.py Sat Jul 01 20:58:34 2017 +0200 +++ b/hgext/automv.py Fri Jun 30 03:27:24 2017 +0200 @@ -32,10 +32,18 @@ copies, error, extensions, + registrar, scmutil, similar ) +configtable = {} +configitem = registrar.configitem(configtable) + +configitem('automv', 'similarity', + default=95, +) + def extsetup(ui): entry = extensions.wrapcommand( commands.table, 'commit', mvcheck) @@ -48,7 +56,7 @@ renames = None disabled = opts.pop('no_automv', False) if not disabled: - threshold = ui.configint('automv', 'similarity', 95) + threshold = ui.configint('automv', 'similarity') if not 0 <= threshold <= 100: raise error.Abort(_('automv.similarity must be between 0 and 100')) if threshold > 0: