diff mercurial/help.py @ 37092:ef6215df2402

fancyopts: prevent mutation of the default value in customopts Differential Revision: https://phab.mercurial-scm.org/D2937
author Daniel Ploch <dploch@google.com>
date Fri, 23 Mar 2018 11:20:49 -0700
parents 979c8ce9022d
children 6890b7e991a4
line wrap: on
line diff
--- a/mercurial/help.py	Thu Mar 22 17:08:25 2018 -0700
+++ b/mercurial/help.py	Fri Mar 23 11:20:49 2018 -0700
@@ -87,7 +87,7 @@
         lo = '--' + longopt
 
         if isinstance(default, fancyopts.customopt):
-            default = default.defaultvalue
+            default = default.getdefaultvalue()
         if default and not callable(default):
             # default is of unknown type, and in Python 2 we abused
             # the %s-shows-repr property to handle integers etc. To