Mercurial > evolve
changeset 5698:5abae69db977
topic: remove unused _orderrevs()
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Mon, 11 Jan 2021 00:20:27 +0800 |
parents | 4070b23cfef2 |
children | 644286633371 |
files | hgext3rd/topic/evolvebits.py |
diffstat | 1 files changed, 0 insertions(+), 35 deletions(-) [+] |
line wrap: on
line diff
--- 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)"""