obshashrange: exit early if nothing to write
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 12 May 2017 20:40:00 +0200
changeset 2361 5c5f982b98f7
parent 2360 89938bebc6f9
child 2362 22c35d07ddb3
obshashrange: exit early if nothing to write
hgext3rd/evolve/obsdiscovery.py
--- a/hgext3rd/evolve/obsdiscovery.py	Fri May 12 20:29:54 2017 +0200
+++ b/hgext3rd/evolve/obsdiscovery.py	Fri May 12 20:40:00 2017 +0200
@@ -512,10 +512,12 @@
         return con
 
     def save(self, repo):
+        if self._cachekey is None:
+            return
+        if self._cachekey == self._ondiskcachekey and not self._new:
+            return
         repo = repo.unfiltered()
         try:
-            if not self._new:
-                return
             with repo.lock():
                 self._save(repo)
         except error.LockError: