Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/help.py @ 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 | 71f692f1f678 |
children | 2cdb1239ff8c |
comparison
equal
deleted
inserted
replaced
31274:063d7957fa12 | 31275:79715ba22f9c |
---|---|
616 | 616 |
617 Either returns the rendered help text or raises an exception. | 617 Either returns the rendered help text or raises an exception. |
618 """ | 618 """ |
619 if keep is None: | 619 if keep is None: |
620 keep = [] | 620 keep = [] |
621 else: | |
622 keep = list(keep) # make a copy so we can mutate this later | |
621 fullname = name | 623 fullname = name |
622 section = None | 624 section = None |
623 subtopic = None | 625 subtopic = None |
624 if name and '.' in name: | 626 if name and '.' in name: |
625 name, remaining = name.split('.', 1) | 627 name, remaining = name.split('.', 1) |