Page MenuHomePhabricator

share: introduce config option to store requires in .hg/store
Needs ReviewPublic

Authored by pulkit on Jun 15 2020, 11:03 AM.

Details

Reviewers
durin42
marmoute
Group Reviewers
hg-reviewers
Summary

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.

Diff Detail

Repository
rHG Mercurial
Branch
default
Lint
No Linters Available
Unit
No Unit Test Coverage

Event Timeline

pulkit created this revision.Jun 15 2020, 11:03 AM
pulkit edited the summary of this revision. (Show Details)Jun 25 2020, 4:52 AM
pulkit updated this revision to Diff 21702.
pulkit updated this revision to Diff 21740.Jul 1 2020, 6:00 AM
marmoute requested changes to this revision.Wed, Jul 15, 1:58 PM
marmoute added a subscriber: marmoute.
marmoute added inline comments.
mercurial/localrepo.py
455

Until the semantic is fully implemented, this should be exp-sharesafe otherwise a non complying client could accessing without respecting the semantic.

537–554

This looks like a lot of duplicated code, am I missing something ? Could we do less duplication?

3507–3520

It looks like share-safe should requires store, can we make them dependent of each other.

This revision now requires changes to proceed.Wed, Jul 15, 1:58 PM
pulkit marked 2 inline comments as done.Fri, Jul 17, 10:24 AM
pulkit added inline comments.
mercurial/localrepo.py
455

Done.

537–554

Refactored in next patch.

3507–3520

Does not share extension implies that store is present?

marmoute added inline comments.Mon, Jul 20, 1:05 PM
mercurial/localrepo.py
537–554

I see this is done in D8655 thanks !

3507–3520

Maybe, can you check ?

In all cases, I would rather make the safe-share requirement consistent from the start. Can we have some code either setup store automatically, or reject with some error (whichever solution you prefer).

pulkit updated this revision to Diff 22068.Thu, Jul 23, 10:52 AM
pulkit updated this revision to Diff 22171.Sat, Aug 1, 10:36 AM