changeset 6111:9d46ec878977

evolve: update comments and docstrings related to _sorted_divergents() One comment is dropped because it was outdated and is covered by the docstring already.
author Anton Shestakov <av6@dwimlabs.net>
date Fri, 10 Dec 2021 13:00:22 +0300
parents fc3ad54219d7
children a6e93dc6e570
files hgext3rd/evolve/evolvecmd.py
diffstat 1 files changed, 2 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/hgext3rd/evolve/evolvecmd.py	Tue Dec 14 17:44:53 2021 +0300
+++ b/hgext3rd/evolve/evolvecmd.py	Fri Dec 10 13:00:22 2021 +0300
@@ -1138,18 +1138,14 @@
     Fall back to rev number, but in ascending order, for historical reasons.
     """
     ledmap = {
-        # For purpose of comparing, from `led` which is (unixtime, offset)
-        # we only need `unixtime`.
+        # for comparing, we only need unixtime from (unixtime, offset)
         rev: latest_evolution_date(repo, repo[rev])[0]
         for rev in divergent_revs
     }
-    # Sorting by negating the `rev` in key func, to fallback to the old way
-    # of selecting revision, in case when `led` is same while comparing.
-    # Old way: was to select the one with minimum revision number
     return sorted(divergent_revs, key=lambda rev: (-ledmap[rev], rev))
 
 def latest_evolution_date(repo, ctx):
-    """Return latest evolution date of `ctx`"""
+    """Return latest evolution date of `ctx` as (unixtime, offset)"""
     node = ctx.node()
     nodes = list(obsutil.closestpredecessors(repo, node))
     nodes.append(node)