status: fix default value of status struct
authorYuya Nishihara <yuya@tcha.org>
Thu, 21 Nov 2019 22:52:23 +0900
changeset 43795 b5f183eedd98
parent 43794 064c9a4ced4a
child 43796 faa8a59f4a06
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.
mercurial/scmutil.py
--- 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