This is an archive of the discontinued Mercurial Phabricator instance.

repository: define manifest interfaces
ClosedPublic

Authored by indygreg on Jun 30 2018, 9:35 PM.

Details

Summary

The long march towards declaring interfaces for repository
primitives continues.

This commit essentially defines interfaces based on the following
types:

  • manifest.manifestdict -> imanifestdict
  • manifest.manifestlog -> imanifestlog
  • manifest.memmanifestctx -> imanifestrevisionwritable
  • manifest.manifestctx -> imanifestrevisionstored
  • manifest.memtreemanifestctx -> imanifestrevisionwritable
  • manifest.treemanifestctx -> imanifestrevisionstored
  • util.dirs -> idirs

The interfaces are thoroughly documented. Their documentation is
now better than the documentation in manifest.py in many cases.

With the exception of util.dirs, classes have been annotated with
their interfaces. (I didn't feel like util.dirs needed the
proper interface treatment.)

Tests have been added demonstrating that all classes and instances
conform to their interfaces.

This work was much easier than filelogs. That's because Durham
did an excellent job formalizing the manifest API a while back.

There are still some minor kludges with the interfaces that should
probably be addressed. But the primary goal with interface
declarations is getting something established. Once we have an
interface, we can modify it later easily enough.

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.

Event Timeline

indygreg created this revision.Jun 30 2018, 9:35 PM
durin42 accepted this revision.Jul 3 2018, 1:40 PM
This revision is now accepted and ready to land.Jul 3 2018, 1:40 PM
This revision was automatically updated to reflect the committed changes.