changeset 31275:79715ba22f9c

help: avoid mutating passed-in `keep` list in `formattedhelp`
author Augie Fackler <augie@google.com>
date Wed, 08 Mar 2017 18:31:33 -0500
parents 063d7957fa12
children 8089de5fab89
files mercurial/help.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/help.py	Fri Mar 03 13:32:10 2017 -0500
+++ b/mercurial/help.py	Wed Mar 08 18:31:33 2017 -0500
@@ -618,6 +618,8 @@
     """
     if keep is None:
         keep = []
+    else:
+        keep = list(keep) # make a copy so we can mutate this later
     fullname = name
     section = None
     subtopic = None