evolve: document the "if not shouldupdate" block
authorMartin von Zweigbergk <martinvonz@google.com>
Wed, 23 Jan 2019 12:11:36 -0800
changeset 4377 c2f9de28415a
parent 4376 0fbf895ce160
child 4378 0b97d4bea7e0
evolve: document the "if not shouldupdate" block I missed the "not" in "if not shouldupdate: ... hg.updaterepo()" and it took a long time for me to realize it's about updating *back* to the original commit (or to its successor). Let's add a comment to maybe help the person not make the same mistake.
hgext3rd/evolve/evolvecmd.py
--- a/hgext3rd/evolve/evolvecmd.py	Wed Jan 23 11:55:20 2019 -0800
+++ b/hgext3rd/evolve/evolvecmd.py	Wed Jan 23 12:11:36 2019 -0800
@@ -1289,6 +1289,8 @@
         compat.progress(ui, _('evolve'), None)
 
     if not shouldupdate:
+        # Move back to startnode, or to its successor if the start node is
+        # obsolete (perhaps made obsolete by the current `hg evolve`)
         unfi = repo.unfiltered()
         succ = utility._singlesuccessor(repo, unfi[startnode])
         hg.updaterepo(repo, repo[succ].node(), False)