Mercurial > evolve
diff hgext3rd/topic/stack.py @ 4828:aaf8742e09a0 stable
stack: demonstrate that not reusing cached property gives different results
Instead of using self._dependencies, which is a cached property, let's get
fresh deps and rdeps in stack.revs method using a newly introduced
stack.builddependencies method (will be removed in the next patch).
This makes it easier to explain why the next patch is correct.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Fri, 06 Sep 2019 12:16:34 +0700 |
parents | f30c1fab7155 |
children | 6b82b4f72347 |
line wrap: on
line diff
--- a/hgext3rd/topic/stack.py Tue Sep 03 13:02:20 2019 +0700 +++ b/hgext3rd/topic/stack.py Fri Sep 06 12:16:34 2019 +0700 @@ -88,6 +88,9 @@ @util.propertycache def _dependencies(self): + return self.builddependencies() + + def builddependencies(self): deps, rdeps = builddependencies(self._repo, self._revs) repo = self._repo @@ -143,7 +146,7 @@ # processed dependency graph. # Step 1: compute relation of revision with each other - dependencies, rdependencies = self._dependencies + dependencies, rdependencies = self.builddependencies() dependencies = dependencies.copy() rdependencies = rdependencies.copy() # Step 2: Build the ordering