# HG changeset patch # User Augie Fackler # Date 2017-03-08 23:31:33 # Node ID 79715ba22f9c873d0425894091c318ca958da8e5 # Parent 063d7957fa1299b6ee51384c9188acc66aea9d6a help: avoid mutating passed-in `keep` list in `formattedhelp` diff --git a/mercurial/help.py b/mercurial/help.py --- a/mercurial/help.py +++ b/mercurial/help.py @@ -618,6 +618,8 @@ def formattedhelp(ui, name, keep=None, u """ if keep is None: keep = [] + else: + keep = list(keep) # make a copy so we can mutate this later fullname = name section = None subtopic = None