obscache: pre-indent code
authorPierre-Yves David <pierre-yves.david@octobus.net>
Thu, 15 Jun 2017 11:31:07 +0200
changeset 2568 ea0889178dbb
parent 2567 6eb87513024b
child 2569 427f6091250e
obscache: pre-indent code This will make the next changeset clearer.
hgext3rd/evolve/obscache.py
--- 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