Mercurial > public > mercurial-scm > hg
diff mercurial/dirstate.py @ 48685:21ac6aedd5e5
transaction: do not rely on a global variable to post_finalize file
We can just add a new argument to the `addfilegenerator` function. This is more
explicit and therefor clearer and less error prone.
Differential Revision: https://phab.mercurial-scm.org/D12125
author | Pierre-Yves David <pierre-yves.david@octobus.net> |
---|---|
date | Mon, 31 Jan 2022 18:38:15 +0100 |
parents | 568f63b5a30f |
children | 5ba24e886cec |
line wrap: on
line diff
--- a/mercurial/dirstate.py Mon Jan 31 08:44:48 2022 +0100 +++ b/mercurial/dirstate.py Mon Jan 31 18:38:15 2022 +0100 @@ -730,12 +730,14 @@ (self._filename_tk,), lambda f: self._write_tracked_key(tr, f), location=b'plain', + post_finalize=True, ) tr.addfilegenerator( b'dirstate-1-main', (self._filename,), lambda f: self._writedirstate(tr, f), location=b'plain', + post_finalize=True, ) if write_key: tr.addfilegenerator( @@ -743,6 +745,7 @@ (self._filename_tk,), lambda f: self._write_tracked_key(tr, f), location=b'plain', + post_finalize=True, ) return @@ -1425,6 +1428,7 @@ (self._filename,), lambda f: self._writedirstate(tr, f), location=b'plain', + post_finalize=True, ) # ensure that pending file written above is unlinked at