Mercurial > public > mercurial-scm > hg
diff mercurial/localrepo.py @ 23510:065c0334846f
fncache: drop dedicated 'onclose' function in favor of 'tr.addfinalize'
Now that we have a shiny generic mechanism, we can use it.
author | Pierre-Yves David <pierre-yves.david@fb.com> |
---|---|
date | Thu, 04 Dec 2014 13:49:45 -0800 |
parents | 19ebd2f88fc7 |
children | acc73273b27e |
line wrap: on
line diff
--- a/mercurial/localrepo.py Tue Dec 09 13:32:19 2014 -0600 +++ b/mercurial/localrepo.py Thu Dec 04 13:49:45 2014 -0800 @@ -883,9 +883,6 @@ _("abandoned transaction found"), hint=_("run 'hg recover' to clean up transaction")) - def onclose(): - self.store.write(self._transref()) - self._writejournal(desc) renames = [(vfs, x, undoname(x)) for vfs, x in self._journalfiles()] rp = report and report or self.ui.warn @@ -893,8 +890,8 @@ tr = transaction.transaction(rp, self.sopener, vfsmap, "journal", aftertrans(renames), - self.store.createmode, - onclose) + self.store.createmode) + tr.addfinalize('repo.store.write', self.store.write) self._transref = weakref.ref(tr) return tr