# HG changeset patch # User Henrik Stuart # Date 2009-04-15 17:54:22 # Node ID ecf7795479d519d9abf217956d418c54239e11f6 # Parent 9f14b66830a81a60ca980feb1d0d625d09b88a1a transaction: support multiple, separate transactions Solves that committed (closed) transactions may linger and be returned on subsequent transaction calls, even though a new transaction should be made, rather than a new nested transaction. This also fixes a race condition with the use of weakref. diff --git a/mercurial/localrepo.py b/mercurial/localrepo.py --- a/mercurial/localrepo.py +++ b/mercurial/localrepo.py @@ -593,8 +593,9 @@ class localrepository(repo.repository): return self._filter("decode", filename, data) def transaction(self): - if self._transref and self._transref(): - return self._transref().nest() + tr = self._transref and self._transref() or None + if tr and tr.running(): + return tr.nest() # abort here if the journal already exists if os.path.exists(self.sjoin("journal")):