This is an archive of the discontinued Mercurial Phabricator instance.

localrepo: use peer interfaces
ClosedPublic

Authored by indygreg on Aug 11 2017, 12:20 AM.

Details

Summary

We now have a formal abstract base class for peers. Let's
transition the peer classes in localrepo to it.

As part of the transition, we reorder methods so they are grouped
by interface and match the order they are defined in the interface.
We also had to change self.ui from an instance attribute to a
property to satisfy the @abstractproperty requirement.

As part of this change, we uncover the first "bug" as part of
enforcing interfaces: stream_out() wasn't implemented on localpeer!
This isn't technically a bug since the repo isn't advertising the
stream capability, so clients shouldn't be attempting to call it.
But I don't think there's a good reason why this is the case.
We implement a dummy method to satisfy the interface requriements.
We can make localpeer instances streamable as a future enhancement.

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.Aug 11 2017, 12:20 AM
durin42 accepted this revision.Aug 11 2017, 2:27 PM
This revision is now accepted and ready to land.Aug 11 2017, 2:27 PM
This revision was automatically updated to reflect the committed changes.