changeset 2568:ea0889178dbb

obscache: pre-indent code This will make the next changeset clearer.
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Thu, 15 Jun 2017 11:31:07 +0200
parents 6eb87513024b
children 427f6091250e
files hgext3rd/evolve/obscache.py
diffstat 1 files changed, 17 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/obscache.py	Thu Jun 15 13:26:05 2017 +0200
+++ b/hgext3rd/evolve/obscache.py	Thu Jun 15 11:31:07 2017 +0200
@@ -520,23 +520,24 @@
                 self.obsstore.obscache.clear()
             super(obscacherepo, self).destroyed()
 
-        def transaction(self, *args, **kwargs):
-            tr = super(obscacherepo, self).transaction(*args, **kwargs)
-            reporef = weakref.ref(self)
+        if True:
+            def transaction(self, *args, **kwargs):
+                tr = super(obscacherepo, self).transaction(*args, **kwargs)
+                reporef = weakref.ref(self)
 
-            def _warmcache(tr):
-                repo = reporef()
-                if repo is None:
-                    return
-                repo = repo.unfiltered()
-                # As pointed in 'obscache.update', we could have the changelog
-                # and the obsstore in charge of updating the cache when new
-                # items goes it. The tranaction logic would then only be
-                # involved for the 'pending' and final writing on disk.
-                self.obsstore.obscache.update(repo)
-                self.obsstore.obscache.save(repo)
+                def _warmcache(tr):
+                    repo = reporef()
+                    if repo is None:
+                        return
+                    repo = repo.unfiltered()
+                    # As pointed in 'obscache.update', we could have the changelog
+                    # and the obsstore in charge of updating the cache when new
+                    # items goes it. The tranaction logic would then only be
+                    # involved for the 'pending' and final writing on disk.
+                    self.obsstore.obscache.update(repo)
+                    self.obsstore.obscache.save(repo)
 
-            tr.addpostclose('warmcache-obscache', _warmcache)
-            return tr
+                tr.addpostclose('warmcache-obscache', _warmcache)
+                return tr
 
     repo.__class__ = obscacherepo