Page MenuHomePhabricator

interfaces: create a new folder for interfaces and move repository.py in it
ClosedPublic

Authored by pulkit on Aug 17 2019, 7:42 PM.

Details

Summary

I was trying to understand current interfaces and write new ones and I realized
we need to improve how current interfaces are organised. This creates a
dedicated folder for defining interfaces and move repository.py which defines
all the current interfaces inside 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.

Event Timeline

pulkit created this revision.Aug 17 2019, 7:42 PM

I was trying to understand current interfaces and write new ones and I realized
we need to improve how current interfaces are organised.

And what was the reason we need to improve it? I assume we don't really "need" to change it. Will it somehow help with future patches? Or you just like this structure better?

I was trying to understand current interfaces and write new ones and I realized
we need to improve how current interfaces are organised.

And what was the reason we need to improve it? I assume we don't really "need" to change it. Will it somehow help with future patches? Or you just like this structure better?

Looking through Augie's hgit patch, I found we need to add more interfaces and decided to work on adding for store.basicstore. I found all the current interfaces in repository.py which has grown very large. I decided to create a new file to have interface for the store class, and maybe a new one for dirstate too, and having them in a separate folder dedicated to interfaces will be nice.

In D6741#99023, @pulkit wrote:

I was trying to understand current interfaces and write new ones and I realized
we need to improve how current interfaces are organised.

And what was the reason we need to improve it? I assume we don't really "need" to change it. Will it somehow help with future patches? Or you just like this structure better?

Looking through Augie's hgit patch, I found we need to add more interfaces and decided to work on adding for store.basicstore. I found all the current interfaces in repository.py which has grown very large. I decided to create a new file to have interface for the store class, and maybe a new one for dirstate too, and having them in a separate folder dedicated to interfaces will be nice.

I'm inclined to agree - the repository.py file full of interfaces has gotten crufty. It'd be nice to split it out into more files by topic.

In D6741#99023, @pulkit wrote:

I was trying to understand current interfaces and write new ones and I realized
we need to improve how current interfaces are organised.

And what was the reason we need to improve it? I assume we don't really "need" to change it. Will it somehow help with future patches? Or you just like this structure better?

Looking through Augie's hgit patch, I found we need to add more interfaces and decided to work on adding for store.basicstore. I found all the current interfaces in repository.py which has grown very large. I decided to create a new file to have interface for the store class, and maybe a new one for dirstate too, and having them in a separate folder dedicated to interfaces will be nice.

I'm inclined to agree - the repository.py file full of interfaces has gotten crufty. It'd be nice to split it out into more files by topic.

That makes sense to me too.

indygreg accepted this revision.Sun, Aug 25, 12:06 PM

It sounds like we're in agreement that interfaces need to be split. Moving everything to a sub-package seems like a logical first step.

This revision is now accepted and ready to land.Sun, Aug 25, 12:06 PM