Mercurial > hg
comparison mercurial/localrepo.py @ 28162:3784d9eb7245
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.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Sat, 13 Feb 2016 14:42:17 -0800 |
parents | e219dbfd0342 |
children | 5d3495e394d5 |
comparison
equal
deleted
inserted
replaced
28161:3324345a498e | 28162:3784d9eb7245 |
---|---|
283 if not self.vfs.isdir(): | 283 if not self.vfs.isdir(): |
284 if create: | 284 if create: |
285 if not self.wvfs.exists(): | 285 if not self.wvfs.exists(): |
286 self.wvfs.makedirs() | 286 self.wvfs.makedirs() |
287 self.vfs.makedir(notindexed=True) | 287 self.vfs.makedir(notindexed=True) |
288 self.requirements.update(self._baserequirements(create)) | 288 requirements = set(self._baserequirements(create)) |
289 if self.ui.configbool('format', 'usestore', True): | 289 if self.ui.configbool('format', 'usestore', True): |
290 self.vfs.mkdir("store") | 290 self.vfs.mkdir("store") |
291 self.requirements.add("store") | 291 requirements.add("store") |
292 if self.ui.configbool('format', 'usefncache', True): | 292 if self.ui.configbool('format', 'usefncache', True): |
293 self.requirements.add("fncache") | 293 requirements.add("fncache") |
294 if self.ui.configbool('format', 'dotencode', True): | 294 if self.ui.configbool('format', 'dotencode', True): |
295 self.requirements.add('dotencode') | 295 requirements.add('dotencode') |
296 # create an invalid changelog | 296 # create an invalid changelog |
297 self.vfs.append( | 297 self.vfs.append( |
298 "00changelog.i", | 298 "00changelog.i", |
299 '\0\0\0\2' # represents revlogv2 | 299 '\0\0\0\2' # represents revlogv2 |
300 ' dummy changelog to prevent using the old repo layout' | 300 ' dummy changelog to prevent using the old repo layout' |
301 ) | 301 ) |
302 if scmutil.gdinitconfig(self.ui): | 302 if scmutil.gdinitconfig(self.ui): |
303 self.requirements.add("generaldelta") | 303 requirements.add("generaldelta") |
304 if self.ui.configbool('experimental', 'treemanifest', False): | 304 if self.ui.configbool('experimental', 'treemanifest', False): |
305 self.requirements.add("treemanifest") | 305 requirements.add("treemanifest") |
306 if self.ui.configbool('experimental', 'manifestv2', False): | 306 if self.ui.configbool('experimental', 'manifestv2', False): |
307 self.requirements.add("manifestv2") | 307 requirements.add("manifestv2") |
308 | |
309 self.requirements = requirements | |
308 else: | 310 else: |
309 raise error.RepoError(_("repository %s not found") % path) | 311 raise error.RepoError(_("repository %s not found") % path) |
310 elif create: | 312 elif create: |
311 raise error.RepoError(_("repository %s already exists") % path) | 313 raise error.RepoError(_("repository %s already exists") % path) |
312 else: | 314 else: |