API issues

Martin Pool martinpool at gmail.com
Fri Sep 16 01:59:50 BST 2005


On 16/09/05, Gustavo Niemeyer <gustavo at niemeyer.net> wrote:

> That'd be nice. We could even use the WorkingBranch class me and Scott
> have been working on as a starting point. It implements a few interesting
> details which could be desirable in a higher level interface.

What does it do?

> Functions are not bad at all, but using many different approaches
> creates inconsistencies, and this is undesirable. Currently, we have
> the add.smart_add() function which calls the Branch.add() class/method,
> but no remove.smart_remove() and no remove.py at all. OTOH, we do have
> commit.py, and we have the Branch.commit() class/method which actually
> calls the commit.commit() function blindly (no arg check), and the later
> is a one liner which calls the Commit().commit() class/method blindly
> again.
> 
> This is looking a bit uncomfortable, IMO. 

I agree.  There are different patterns because we're still learning
about the space, not because I like them being inconsistent.  At first
a lot of things were done directly in Branch and that got
unmanageable.

Perhaps things like commit.py and add.py should be called only by the
Branch object and put there just to move the implementation of the
code away from the Branch class.

-- 
Martin




More information about the bazaar mailing list