Patchwork [04,of,10] config: use the new '_unset' value for 'configint'

login
register
mail settings
Submitter Pierre-Yves David
Date June 18, 2017, 6:55 p.m.
Message ID <11f995470103d355c41e.1497812114@nodosa.octopoid.net>
Download mbox | patch
Permalink /patch/21483/
State Accepted
Headers show

Comments

Pierre-Yves David - June 18, 2017, 6:55 p.m.
# HG changeset patch
# User Pierre-Yves David <pierre-yves.david@octobus.net>
# Date 1497696820 -7200
#      Sat Jun 17 12:53:40 2017 +0200
# Node ID 11f995470103d355c41e2bfc7b37160175f026cd
# Parent  3984cb4c86deba1c255208f6c2e4a98f4aff227b
# EXP-Topic config.register
# Available At https://www.mercurial-scm.org/repo/users/marmoute/mercurial/
#              hg pull https://www.mercurial-scm.org/repo/users/marmoute/mercurial/ -r 11f995470103
config: use the new '_unset' value for 'configint'

This should let 'configint' delegates all special processing of the default
config value to the main 'config' method.

Patch

diff --git a/mercurial/ui.py b/mercurial/ui.py
--- a/mercurial/ui.py
+++ b/mercurial/ui.py
@@ -536,7 +536,7 @@  class ui(object):
             raise error.ConfigError(_("%s.%s is not a valid %s ('%s')")
                                     % (section, name, desc, v))
 
-    def configint(self, section, name, default=None, untrusted=False):
+    def configint(self, section, name, default=_unset, untrusted=False):
         """parse a configuration element as an integer
 
         >>> u = ui(); s = 'foo'