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.
--- 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):