Commit 9a06d69d authored by Anton Shestakov's avatar Anton Shestakov
Browse files

next: make `filtered` a set of revs, not contexts

Uses less memory this way and simplifies content checks in a couple of places.
parent 1ed3e1f2d2c3
......@@ -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,5 +857,5 @@
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)
......@@ -861,5 +861,5 @@
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment