Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 45300:dc457177dbc1
localrepo: only use 'bookmarksinstore' requirement if we have 'store'
This adds check that whether we have the 'store' requirement or not. If we don't
have that, we skip adding the 'bookmarksinstore' requirement and warn user about
it.
Differential Revision: https://phab.mercurial-scm.org/D8771
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Tue, 21 Jul 2020 13:58:58 +0530 |
parents | ce9ee81df9ff |
children | dc283bc7e033 |
comparison
equal
deleted
inserted
replaced
45299:e98f7c5babd7 | 45300:dc457177dbc1 |
---|---|
3313 requirements.add(NODEMAP_REQUIREMENT) | 3313 requirements.add(NODEMAP_REQUIREMENT) |
3314 | 3314 |
3315 return requirements | 3315 return requirements |
3316 | 3316 |
3317 | 3317 |
3318 def checkrequirementscompat(ui, requirements): | |
3319 """ Checks compatibility of repository requirements enabled and disabled. | |
3320 | |
3321 Returns a set of requirements which needs to be dropped because dependend | |
3322 requirements are not enabled. Also warns users about it """ | |
3323 | |
3324 dropped = set() | |
3325 | |
3326 if b'store' not in requirements: | |
3327 if bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT in requirements: | |
3328 ui.warn( | |
3329 _( | |
3330 b'ignoring enabled \'format.bookmarks-in-store\' config ' | |
3331 b'beacuse it is incompatible with disabled ' | |
3332 b'\'format.usestore\' config\n' | |
3333 ) | |
3334 ) | |
3335 dropped.add(bookmarks.BOOKMARKS_IN_STORE_REQUIREMENT) | |
3336 | |
3337 return dropped | |
3338 | |
3339 | |
3318 def filterknowncreateopts(ui, createopts): | 3340 def filterknowncreateopts(ui, createopts): |
3319 """Filters a dict of repo creation options against options that are known. | 3341 """Filters a dict of repo creation options against options that are known. |
3320 | 3342 |
3321 Receives a dict of repo creation options and returns a dict of those | 3343 Receives a dict of repo creation options and returns a dict of those |
3322 options that we don't know how to handle. | 3344 options that we don't know how to handle. |
3387 % b', '.join(sorted(unknownopts)), | 3409 % b', '.join(sorted(unknownopts)), |
3388 hint=_(b'is a required extension not loaded?'), | 3410 hint=_(b'is a required extension not loaded?'), |
3389 ) | 3411 ) |
3390 | 3412 |
3391 requirements = newreporequirements(ui, createopts=createopts) | 3413 requirements = newreporequirements(ui, createopts=createopts) |
3414 requirements -= checkrequirementscompat(ui, requirements) | |
3392 | 3415 |
3393 wdirvfs = vfsmod.vfs(path, expandpath=True, realpath=True) | 3416 wdirvfs = vfsmod.vfs(path, expandpath=True, realpath=True) |
3394 | 3417 |
3395 hgvfs = vfsmod.vfs(wdirvfs.join(b'.hg')) | 3418 hgvfs = vfsmod.vfs(wdirvfs.join(b'.hg')) |
3396 if hgvfs.exists(): | 3419 if hgvfs.exists(): |