changeset 2361:5c5f982b98f7

obshashrange: exit early if nothing to write
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Fri, 12 May 2017 20:40:00 +0200
parents 89938bebc6f9
children 22c35d07ddb3
files hgext3rd/evolve/obsdiscovery.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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: