# HG changeset patch # User Kyle Lippincott # Date 1568662970 25200 # Node ID 0fecff9ac36d9d606f5777eb86077a9889545fd4 # Parent 38ce7fe4d3f210d4c606f0de1312daeee4a63462 cmdstate: avoid setting a default argument to a mutable object (`{}`) If there's ever more than one cmdstate for the lifetime of the process, this can cause surprising behavior where the later cmdstates pick up options from the earlier ones. I've not seen any evidence this is actually causing any issues, but it's subtle enough that it should probably be fixed to help save significant debugging time later. diff -r 38ce7fe4d3f2 -r 0fecff9ac36d hgext3rd/evolve/state.py --- a/hgext3rd/evolve/state.py Mon Sep 16 12:42:11 2019 -0700 +++ b/hgext3rd/evolve/state.py Mon Sep 16 12:42:50 2019 -0700 @@ -37,9 +37,11 @@ can populate the object data reading that file """ - def __init__(self, repo, path=b'evolvestate', opts={}): + def __init__(self, repo, path=b'evolvestate', opts=None): self._repo = repo self.path = path + if opts is None: + opts = {} self.opts = opts def __nonzero__(self):