evolve: declare updated and pctx variables in stopevolve()
authorPulkit Goyal <7895pulkit@gmail.com>
Mon, 11 Jun 2018 00:43:39 +0530
changeset 3826 8e8bd5bb2f90
parent 3825 b5dfa78073b9
child 3827 82c72eb37f85
evolve: declare updated and pctx variables in stopevolve() They will used in next patch.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Sun Jun 10 22:52:11 2018 +0530
+++ b/hgext3rd/evolve/evolvecmd.py	Mon Jun 11 00:43:39 2018 +0530
@@ -1474,8 +1474,11 @@
 
 def stopevolve(ui, repo, evolvestate):
     """logic for handling of `hg evolve --stop`"""
-    pctx = repo['.']
-    hg.updaterepo(repo, pctx.node(), True)
+    updated = False
+    pctx = None
+    if not updated:
+        pctx = repo['.']
+        hg.updaterepo(repo, pctx.node(), True)
     ui.status(_('stopped the interrupted evolve\n'))
     ui.status(_('working directory is now at %s\n') % pctx)