# HG changeset patch # User Pierre-Yves David # Date 1497519067 -7200 # Node ID ea0889178dbb14616650de9ac71c257a767916ce # Parent 6eb87513024b8cd6d2860c742adea6675a6d95aa obscache: pre-indent code This will make the next changeset clearer. diff -r 6eb87513024b -r ea0889178dbb 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