# HG changeset patch # User Anton Shestakov # Date 1619005860 -28800 # Node ID 9a06d69d2ac76f9637c96884579342183571abac # Parent 1ed3e1f2d2c39a9fba37f5619d86ed3e43be3862 next: make `filtered` a set of revs, not contexts Uses less memory this way and simplifies content checks in a couple of places. diff -r 1ed3e1f2d2c3 -r 9a06d69d2ac7 hgext3rd/evolve/__init__.py --- a/hgext3rd/evolve/__init__.py Wed Apr 21 19:44:26 2021 +0800 +++ b/hgext3rd/evolve/__init__.py Wed Apr 21 19:51:00 2021 +0800 @@ -846,8 +846,8 @@ filtered = set() template = shorttemplate if topic and not opts.get("no_topic", False): - filtered = set(ctx for ctx in children if ctx.topic() != topic) - children = [ctx for ctx in children if ctx not in filtered] + filtered = set(ctx.rev() for ctx in children if ctx.topic() != topic) + children = [ctx for ctx in children if ctx.rev() not in filtered] template = utility.stacktemplate opts['stacktemplate'] = True display = compat.format_changeset_summary_fn(ui, repo, b'next', @@ -857,9 +857,9 @@ needevolve = False aspchildren = evolvecmd._aspiringchildren(repo, [repo[b'.'].rev()]) if topic: - filtered.update(repo[rev] for rev in aspchildren + filtered.update(rev for rev in aspchildren if repo[rev].topic() != topic) - aspchildren = [rev for rev in aspchildren if repo[rev] not in filtered] + aspchildren = [rev for rev in aspchildren if rev not in filtered] # To catch and prevent the case when `next` would get confused by split, # lets filter those aspiring children which can be stablized on one of @@ -869,7 +869,7 @@ possdests = evolvecmd._possibledestination(repo, aspchild) if possdests & aspirants: filtered.add(aspchild) - aspchildren = [ctx for ctx in aspchildren if ctx not in filtered] + aspchildren = [rev for rev in aspchildren if rev not in filtered] if aspchildren: needevolve = True