changeset 51957:f3bef5eb12f9 stable

module-policy: ignore empty module policy This make the variable easier to work with, the empty value is not ambiguous about not wanting to get in the way.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 08 Oct 2024 15:54:59 +0200
parents 7ff35f1290c0
children 16574ca8b155
files mercurial/policy.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/policy.py	Fri Sep 27 15:53:56 2024 +0200
+++ b/mercurial/policy.py	Tue Oct 08 15:54:59 2024 +0200
@@ -51,7 +51,7 @@
     policy = b'cffi'
 
 # Environment variable can always force settings.
-if 'HGMODULEPOLICY' in os.environ:
+if os.environ.get('HGMODULEPOLICY'):  # ignore None and Empty
     policy = os.environ['HGMODULEPOLICY'].encode('utf-8')