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

login
register
mail settings
Submitter Anton Shestakov
Date Oct. 25, 2018, 1:43 p.m.
Message ID <7e4ffe2719e4af2a9e56.1540475000@neuro>
Download mbox | patch
Permalink /patch/36277/
State Accepted
Headers show

Comments

Anton Shestakov - Oct. 25, 2018, 1:43 p.m.
# HG changeset patch
# User Anton Shestakov <av6@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.
Yuya Nishihara - Oct. 26, 2018, 11:29 a.m.
On Thu, 25 Oct 2018 21:43:20 +0800, Anton Shestakov wrote:
> # HG changeset patch
> # User Anton Shestakov <av6@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)

Queued for stable, thanks.

Patch

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