[patch 5/7] Automatic nesting into running transactions in the same repository.

Matt Mackall mpm at selenic.com
Mon Aug 22 15:27:52 CDT 2005


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?

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.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial mailing list