crecord: make nextsametype() check that parent item exists (issue6009) stable
authorAnton Shestakov <av6@dwimlabs.net>
Thu, 25 Oct 2018 21:33:43 +0800
branchstable
changeset 40422 7e4ffe2719e4
parent 40421 e928bedf0919
child 40426 588f1e9a4d16
crecord: make nextsametype() check that parent item exists (issue6009) Items that represent files in curses interface don't have parents.
mercurial/crecord.py
--- a/mercurial/crecord.py	Wed Oct 24 10:05:13 2018 -0400
+++ b/mercurial/crecord.py	Thu Oct 25 21:33:43 2018 +0800
@@ -725,7 +725,7 @@
             nextitem = currentitem
         else:
             parent = nextitem.parentitem()
-            if parent.folded:
+            if parent is not None and parent.folded:
                 self.togglefolded(parent)
 
         self.currentselecteditem = nextitem