module-policy: ignore empty module policy stable
authorPierre-Yves David <pierre-yves.david@octobus.net>
Tue, 08 Oct 2024 15:54:59 +0200
branchstable
changeset 51688 f3bef5eb12f9
parent 51687 7ff35f1290c0
child 51689 16574ca8b155
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.
mercurial/policy.py
--- 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')