diff --git a/revup/topic_stack.py b/revup/topic_stack.py index d718eb0..7e6e0b6 100644 --- a/revup/topic_stack.py +++ b/revup/topic_stack.py @@ -513,13 +513,18 @@ async def populate_reviews( if relative_topic: topic.relative_topic = self.topics[relative_topic] + + seen_topics[name] = topic + + for name, topic in list(self.topics.items()): + if topic.relative_topic: if len(topic.tags[TAG_BRANCH]) == 0: topic.tags[TAG_BRANCH].update(topic.relative_topic.tags[TAG_BRANCH]) elif not topic.tags[TAG_BRANCH].issubset(topic.relative_topic.tags[TAG_BRANCH]): raise RevupUsageException( f"Topic {name} has branches" f" {topic.tags[TAG_BRANCH] - topic.relative_topic.tags[TAG_BRANCH]} not in" - f" relative topic {relative_topic}" + f" relative topic {topic.relative_topic.name}" ) if len(topic.tags[TAG_RELATIVE_BRANCH]) == 0: @@ -531,8 +536,8 @@ async def populate_reviews( != topic.relative_topic.tags[TAG_RELATIVE_BRANCH] ): raise RevupUsageException( - f"Topic {name} and relative topic {relative_topic} have differing relative " - f"branches, {topic.tags[TAG_RELATIVE_BRANCH]} vs " + f"Topic {name} and relative topic {topic.relative_topic.name} have " + f"differing relative branches, {topic.tags[TAG_RELATIVE_BRANCH]} vs " f"{topic.relative_topic.tags[TAG_RELATIVE_BRANCH]}" ) else: @@ -571,7 +576,7 @@ async def populate_reviews( ): raise RevupUsageException( f"Topic {name} has uploader '{topic.tags[TAG_UPLOADER]}' while relative topic" - f" {relative_topic} has uploader" + f" {topic.relative_topic.name} has uploader" f" {topic.relative_topic.tags[TAG_UPLOADER] or '{}'}" ) topic_uploader = min(topic.tags[TAG_UPLOADER]) if topic.tags[TAG_UPLOADER] else uploader @@ -633,8 +638,6 @@ async def populate_reviews( if auto_add_users in ("a2r", "both"): topic.tags[TAG_REVIEWER].update(topic.tags[TAG_ASSIGNEE]) - seen_topics[name] = topic - if limit_topics: for name in limit_topics: if name not in self.topics: