changeset 43795:b5f183eedd98

status: fix default value of status struct The default argument isn't overloaded. Before, the default constructor would create a struct having 7 list type objects.
author Yuya Nishihara <yuya@tcha.org>
date Thu, 21 Nov 2019 22:52:23 +0900
parents 064c9a4ced4a
children faa8a59f4a06
files mercurial/scmutil.py
diffstat 1 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/scmutil.py	Tue Nov 19 23:53:12 2019 +0900
+++ b/mercurial/scmutil.py	Thu Nov 21 22:52:23 2019 +0900
@@ -70,13 +70,13 @@
     relevant to the working copy.
     '''
 
-    modified = attr.ib(default=list)
-    added = attr.ib(default=list)
-    removed = attr.ib(default=list)
-    deleted = attr.ib(default=list)
-    unknown = attr.ib(default=list)
-    ignored = attr.ib(default=list)
-    clean = attr.ib(default=list)
+    modified = attr.ib(default=attr.Factory(list))
+    added = attr.ib(default=attr.Factory(list))
+    removed = attr.ib(default=attr.Factory(list))
+    deleted = attr.ib(default=attr.Factory(list))
+    unknown = attr.ib(default=attr.Factory(list))
+    ignored = attr.ib(default=attr.Factory(list))
+    clean = attr.ib(default=attr.Factory(list))
 
     def __iter__(self):
         yield self.modified