Mercurial > hg
changeset 38918:2ac40e86f604
absorb: avoid mutable default arg
Differential Revision: https://phab.mercurial-scm.org/D4043
author | Augie Fackler <augie@google.com> |
---|---|
date | Wed, 01 Aug 2018 18:23:28 -0400 |
parents | 5111d11b8719 |
children | dc4750b2a04e |
files | hgext/absorb.py |
diffstat | 1 files changed, 3 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/hgext/absorb.py Mon Jul 30 14:05:56 2018 -0400 +++ b/hgext/absorb.py Wed Aug 01 18:23:28 2018 -0400 @@ -126,7 +126,7 @@ result.reverse() return result -def getfilestack(stack, path, seenfctxs=set()): +def getfilestack(stack, path, seenfctxs=None): """([ctx], str, set) -> [fctx], {ctx: fctx} stack is a list of contexts, from old to new. usually they are what @@ -163,6 +163,8 @@ - if stack = [6, 7], returns ([1, 2], {6: 1, 7: 2}), although {6: 1} can be removed, since 1 is immutable. """ + if seenfctxs is None: + seenfctxs = set() assert stack if path not in stack[-1]: