# HG changeset patch # User Anton Shestakov # Date 1610295627 -28800 # Node ID 5abae69db9771f452026b0e88ddc268835f972a0 # Parent 4070b23cfef205948179e1f587f75c2c7aaff042 topic: remove unused _orderrevs() diff -r 4070b23cfef2 -r 5abae69db977 hgext3rd/topic/evolvebits.py --- a/hgext3rd/topic/evolvebits.py Fri Oct 30 13:42:33 2020 -0700 +++ b/hgext3rd/topic/evolvebits.py Mon Jan 11 00:20:27 2021 +0800 @@ -6,41 +6,6 @@ # Copied from evolve 081605c2e9b6 -def _orderrevs(repo, revs): - """Compute an ordering to solve instability for the given revs - - revs is a list of unstable revisions. - - Returns the same revisions ordered to solve their instability from the - bottom to the top of the stack that the stabilization process will produce - eventually. - - This ensures the minimal number of stabilizations, as we can stabilize each - revision on its final stabilized destination. - """ - # Step 1: Build the dependency graph - dependencies, rdependencies = builddependencies(repo, revs) - # Step 2: Build the ordering - # Remove the revisions with no dependency(A) and add them to the ordering. - # Removing these revisions leads to new revisions with no dependency (the - # one depending on A) that we can remove from the dependency graph and add - # to the ordering. We progress in a similar fashion until the ordering is - # built - solvablerevs = [r for r in sorted(dependencies.keys()) - if not dependencies[r]] - ordering = [] - while solvablerevs: - rev = solvablerevs.pop() - for dependent in rdependencies[rev]: - dependencies[dependent].remove(rev) - if not dependencies[dependent]: - solvablerevs.append(dependent) - del dependencies[rev] - ordering.append(rev) - - ordering.extend(sorted(dependencies)) - return ordering - def builddependencies(repo, revs): """returns dependency graphs giving an order to solve instability of revs (see _orderrevs for more information on usage)"""