This is an archive of the discontinued Mercurial Phabricator instance.

localrepo: read requirements file in makelocalrepository()
ClosedPublic

Authored by indygreg on Sep 13 2018, 12:29 PM.

Details

Summary

Previously, scmutil.readrequires() loaded the requirements file
and validated its content against what was supported.

Requirements translate to repository features and are critical to
our plans to dynamically create local repository types. So, we must
load them in makelocalrepository() before a repository instance is
constructed.

This commit moves the reading of the .hg/requires file to
makelocalrepository(). Because scmutil.readrequires() was performing
I/O and validation, we inlined the validation into
localrepository.init and removed scmutil.readrequires().

I plan to remove scmutil.readrequires() in a future commit (we can't
do it now because statichttprepo uses it).

Diff Detail

Repository
rHG Mercurial
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.