# HG changeset patch # User Pierre-Yves David # Date 1493734384 -7200 # Node ID 2f15090712fe550273bb526e2c86950d5d9badc1 # Parent 8534400111fd2cd2eb2045c94722a95a9ef6c148 obscache: still update and use the cache during transaction Other code might access the obsolete set in the middle of a transaction. It is better to use the case in that case since the update will eventually be written when the transaction is committed. diff -r 8534400111fd -r 2f15090712fe hgext3rd/evolve/obscache.py --- a/hgext3rd/evolve/obscache.py Tue May 02 16:15:01 2017 +0200 +++ b/hgext3rd/evolve/obscache.py Tue May 02 16:13:04 2017 +0200 @@ -334,7 +334,12 @@ # load the obsstore anyway. Once loaded, hitting the obsstore directly # will be about as fast.. if not obscache.uptodate(repo): - return orig(repo) + if repo.currenttransaction() is None: + return orig(repo) + else: + # If a transaction is open, it is worthwhile to update and use the + # cache as it will be written on disk when the transaction close. + obscache.update(repo) isobs = obscache.get for r in notpublic: if isobs(r):