[PATCH STABLE] crecord: make nextsametype() check that parent item exists (issue6009)

Anton Shestakov av6 at dwimlabs.net
Thu Oct 25 13:43:20 UTC 2018


# HG changeset patch
# User Anton Shestakov <av6 at dwimlabs.net>
# Date 1540474423 -28800
#      Thu Oct 25 21:33:43 2018 +0800
# Branch stable
# Node ID 7e4ffe2719e4af2a9e56c9ee097ed6720f5c3906
# Parent  e928bedf0919c7bd851bb4481dfff61c653bd5f9
crecord: make nextsametype() check that parent item exists (issue6009)

Items that represent files in curses interface don't have parents.

diff --git a/mercurial/crecord.py b/mercurial/crecord.py
--- a/mercurial/crecord.py
+++ b/mercurial/crecord.py
@@ -725,7 +725,7 @@ class curseschunkselector(object):
             nextitem = currentitem
         else:
             parent = nextitem.parentitem()
-            if parent.folded:
+            if parent is not None and parent.folded:
                 self.togglefolded(parent)
 
         self.currentselecteditem = nextitem


More information about the Mercurial-devel mailing list