This is an archive of the discontinued Mercurial Phabricator instance.

localrepo: move some vfs initialization out of __init__
ClosedPublic

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

Details

Summary

In order to make repository types more dynamic, we'll need to move the
logic for determining repository behavior out of
localrepository.init so we can influence behavior before the type
is instantiated.

This commit starts that process by moving working directory and .hg/
vfs initialization to our new standalone function for instantiating
local repositories.

Aside from API changes, behavior should be fully backwards compatible.

.. api::

localrepository.__init__ now does less work and accepts new args

Use ``hg.repository()``, ``localrepo.instance()``, or
``localrepo.makelocalrepository()`` to obtain a new local repository
instance instead of calling the ``localrepository`` constructor
directly.

Diff Detail

Repository
rHG Mercurial
Lint
Lint Skipped
Unit
Unit Tests Skipped

Event Timeline

indygreg created this revision.Sep 13 2018, 12:29 PM
durin42 accepted this revision.Sep 15 2018, 12:24 AM
durin42 added a subscriber: durin42.

I think I like where this is headed. Will read rest of series later.

This revision is now accepted and ready to land.Sep 15 2018, 12:24 AM
This revision was automatically updated to reflect the committed changes.