Mercurial > public > mercurial-scm > hg
comparison mercurial/scmutil.py @ 45483:d252f51ab032
share: introduce config option to store requires in .hg/store
This introduces a config option which enabled stores the requirements on a
repository in store instead.
When enabled, `.hg/requires` will contain the `share-safe` requirement which
marks that the requirements are present in the store.
This is done so that repository requirements can be shared with shares made
using `hg share` command.
After this patch, `hg share` checks whether the source repository has
share-safe requirement, if yes, it does not copy the requirements.
Test for the new functionality is added and a test case in exitsing share tests
is also added.
Differential Revision: https://phab.mercurial-scm.org/D8633
author | Pulkit Goyal <7895pulkit@gmail.com> |
---|---|
date | Tue, 14 Apr 2020 21:07:09 +0530 |
parents | 9a99ab8217bd |
children | 89f0d9f87701 |
comparison
equal
deleted
inserted
replaced
45482:9a99ab8217bd | 45483:d252f51ab032 |
---|---|
1477 wcreq: requirements which should be written in .hg/requires | 1477 wcreq: requirements which should be written in .hg/requires |
1478 storereq: which should be written in .hg/store/requires | 1478 storereq: which should be written in .hg/store/requires |
1479 | 1479 |
1480 Returns (wcreq, storereq) | 1480 Returns (wcreq, storereq) |
1481 """ | 1481 """ |
1482 if False: | 1482 if requirementsmod.SHARESAFE_REQUIREMENT in requirements: |
1483 wc, store = set(), set() | 1483 wc, store = set(), set() |
1484 for r in requirements: | 1484 for r in requirements: |
1485 if r in requirementsmod.WORKING_DIR_REQUIREMENTS: | 1485 if r in requirementsmod.WORKING_DIR_REQUIREMENTS: |
1486 wc.add(r) | 1486 wc.add(r) |
1487 else: | 1487 else: |