D4575: localrepo: use boolean in opener options

indygreg (Gregory Szorc) phabricator at mercurial-scm.org
Thu Sep 13 16:31:02 UTC 2018


indygreg created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  Not sure why we're using an integer for a flag value here. I'm
  pretty sure nothing relies on values being 1.
  
  While we're here, convert to a dict literal.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D4575

AFFECTED FILES
  mercurial/localrepo.py

CHANGE DETAILS

diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -818,8 +818,8 @@
         return caps
 
     def _applyopenerreqs(self):
-        self.svfs.options = dict((r, 1) for r in self.requirements
-                                           if r in self.openerreqs)
+        self.svfs.options = {r: True for r in self.requirements
+                             if r in self.openerreqs}
         # experimental config: format.chunkcachesize
         chunkcachesize = self.ui.configint('format', 'chunkcachesize')
         if chunkcachesize is not None:



To: indygreg, #hg-reviewers
Cc: mercurial-devel


More information about the Mercurial-devel mailing list