HomePhabricator

scmutil: add writereporequirements() and route requires writing through it

Authored by pulkit.

Description

scmutil: add writereporequirements() and route requires writing through it

In upcoming patches, to implement Share Safe plan we will be introducing
requires file in store. We need to route all callers to a single function
to check for a share-safe requirement and if present, write requirements to
.hg/store/requires instead.

After this patch, callers directly calling scmutil.writerequires() are only
those where we don't have the repo object, for example when initializing
the repository object itself.

Differential Revision: https://phab.mercurial-scm.org/D8631