# HG changeset patch # User Pierre-Yves David # Date 1499992482 -7200 # Node ID 51d669b16fa88a2eb8d663a4316a65de9860b3da # Parent 51afc979d88d71a932a6c10605ae75d182bc3759 prev: explicitly use 'p1' as a variable name This make the code clearer. diff --git a/hgext3rd/evolve/__init__.py b/hgext3rd/evolve/__init__.py --- a/hgext3rd/evolve/__init__.py +++ b/hgext3rd/evolve/__init__.py @@ -2006,12 +2006,14 @@ def _findprevtarget(repo, displayer, movebookmark=False, topic=True): target = bookmark = None wkctx = repo[None] - wparents = wkctx.parents() - parents = wparents[0].parents() + p1 = wkctx.parents()[0] + parents = p1.parents() currenttopic = getattr(repo, 'currenttopic', '') if currenttopic and topic: parents = [ctx for ctx in parents if ctx.topic() == currenttopic] - if wparents[0].node() == node.nullid: + + # issue message for the various case + if p1.node() == node.nullid: repo.ui.warn(_('already at repository root\n')) elif not parents and currenttopic: repo.ui.warn(_('no parent in topic "%s"\n') % currenttopic)