prev: explicitly use 'p1' as a variable name
authorPierre-Yves David <pierre-yves.david@octobus.net>
Fri, 14 Jul 2017 02:34:42 +0200
changeset 2741 51d669b16fa8
parent 2740 51afc979d88d
child 2742 64fb1a082f58
prev: explicitly use 'p1' as a variable name This make the code clearer.
hgext3rd/evolve/__init__.py
--- a/hgext3rd/evolve/__init__.py	Fri Jul 14 01:53:56 2017 +0200
+++ b/hgext3rd/evolve/__init__.py	Fri Jul 14 02:34:42 2017 +0200
@@ -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)