[patch 5/7] Automatic nesting into running transactions in the
mason at suse.com
Mon Aug 22 18:33:41 CDT 2005
On Mon, 22 Aug 2005 13:27:52 -0700
Matt Mackall <mpm at selenic.com> wrote:
> On Mon, Aug 22, 2005 at 01:44:39PM -0400, Chris Mason wrote:
> > - return transaction.transaction(self.ui.warn, self.opener,
> > + tr = transaction.transaction(self.ui.warn, self.opener,
> > self.join("journal"), after)
> > + # a weak reference is used to avoid a circular ref
> > + self.transhandle = weakref.ref(tr)
> > + return tr
> I've made a great effort to avoid needing to use weakref elsewhere.
> Can we promote the after function to module scope like opener and
> thereby avoid this problem case too?
When I relied 100% on after(), I ran into ordering problems between the
dirstate and the transaction abort code. But I'll put some more
thought into it, I didn't realize weakrefs were bad....
> If we must use weakref, I'd prefer to find a way such that it was
> invisible to users of the transaction class, like using a wrapper.
More information about the Mercurial