Mercurial > evolve
changeset 5881:9a06d69d2ac7 stable
next: make `filtered` a set of revs, not contexts
Uses less memory this way and simplifies content checks in a couple of places.
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Wed, 21 Apr 2021 19:51:00 +0800 |
parents | 1ed3e1f2d2c3 |
children | 1d8148795dc2 |
files | hgext3rd/evolve/__init__.py |
diffstat | 1 files changed, 5 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- 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