changeset 22584:19bd8bda6bb2

minirst: allow multiple container types for prune If we have a container of type x.y, then we can preserve it by keeping x or y.
author Matt Mackall <mpm@selenic.com>
date Tue, 30 Sep 2014 15:48:43 -0500
parents 23c995ed466b
children 15282c6612fb
files mercurial/minirst.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/minirst.py	Thu Sep 04 21:36:35 2014 +0200
+++ b/mercurial/minirst.py	Tue Sep 30 15:48:43 2014 -0500
@@ -261,7 +261,10 @@
             indent = blocks[i]['indent']
             adjustment = blocks[i + 1]['indent'] - indent
             containertype = blocks[i]['lines'][0][15:]
-            prune = containertype not in keep
+            prune = True
+            for c in keep:
+                if c in containertype.split('.'):
+                    prune = False
             if prune:
                 pruned.append(containertype)