[RFC] Add run_cleanup, do_with_cleanup

Martin Pool mbp at canonical.com
Thu Sep 24 09:10:15 BST 2009


2009/9/24 Andrew Bennetts <andrew.bennetts at canonical.com>:
>> My idea was that we should try, at least in a branch, just changing
>> the policy, and see what happens in several dimensions: how that
>> changes the look & feel of the code as you change it, what tests fail
>> if any and how easy & clean it is to fix them, and what positive or
>> negative effects this has on users.  Then we'll have more data on the
>> balance.
>
> Ok, trying it in practice makes good sense.  I might aim for trying to
> update (or at least look at) every try-finally in bzrdir.py, repository.py
> and branch.py and see how it goes.

I'm kind of hoping you won't actually need to change them though, only
the code they call.

> [...]
>> I think that policy sounds ok, though maybe we need different
>> functions for important and unimportant cleanups.  I suggest taking
>> the implementation all the way through with say unlock so that we can
>> see how it actually behaves.
>
> That sounds like a good experiment, although I dread the effort to actually
> update all the implementations of unlock...
>
> (By “all the way through” you mean extending the API of unlock, right?)

By "all the way through" I mean to the point where you can
interactively test (somehow, maybe by killing your network connection)
creating a situation where unlock would run after an error, and
observe that it looks better than it does with the current code.  Not
all the way 'across' every case at first.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list