# HG changeset patch # User Gregory Szorc # Date 1455403337 28800 # Node ID 3784d9eb7245959e15e739fe7fb600ff902eeb89 # Parent 3324345a498eac93c793eca68a8bed88e5335e4a localrepo: use local variable for requirements assignment A future patch will refactor requirements determination into a standalone function. To prepare for this, refactor the requirements code to assign to a local variable instead of to self.requirements. diff -r 3324345a498e -r 3784d9eb7245 mercurial/localrepo.py --- a/mercurial/localrepo.py Tue Feb 09 23:35:21 2016 +0000 +++ b/mercurial/localrepo.py Sat Feb 13 14:42:17 2016 -0800 @@ -285,14 +285,14 @@ if not self.wvfs.exists(): self.wvfs.makedirs() self.vfs.makedir(notindexed=True) - self.requirements.update(self._baserequirements(create)) + requirements = set(self._baserequirements(create)) if self.ui.configbool('format', 'usestore', True): self.vfs.mkdir("store") - self.requirements.add("store") + requirements.add("store") if self.ui.configbool('format', 'usefncache', True): - self.requirements.add("fncache") + requirements.add("fncache") if self.ui.configbool('format', 'dotencode', True): - self.requirements.add('dotencode') + requirements.add('dotencode') # create an invalid changelog self.vfs.append( "00changelog.i", @@ -300,11 +300,13 @@ ' dummy changelog to prevent using the old repo layout' ) if scmutil.gdinitconfig(self.ui): - self.requirements.add("generaldelta") + requirements.add("generaldelta") if self.ui.configbool('experimental', 'treemanifest', False): - self.requirements.add("treemanifest") + requirements.add("treemanifest") if self.ui.configbool('experimental', 'manifestv2', False): - self.requirements.add("manifestv2") + requirements.add("manifestv2") + + self.requirements = requirements else: raise error.RepoError(_("repository %s not found") % path) elif create: