[PATCH 17 of 17 V4] subrepo: use separate instances of empty lists in status

Martin von Zweigbergk martinvonz at gmail.com
Sun Oct 12 00:44:34 CDT 2014


# HG changeset patch
# User Martin von Zweigbergk <martinvonz at gmail.com>
# Date 1413092594 25200
#      Sat Oct 11 22:43:14 2014 -0700
# Node ID ff2b1774db604583e71cf9b65098b4cb7aadce7e
# Parent  b42e9155352d825a8fe9385d1189c9c7a83fc6a9
subrepo: use separate instances of empty lists in status

We do modify the lists that make up the status in several places, so
it seems risky to use the same instance of a list for several
different status types. Use a separate empty list for each type
instead.

diff --git a/mercurial/subrepo.py b/mercurial/subrepo.py
--- a/mercurial/subrepo.py
+++ b/mercurial/subrepo.py
@@ -1583,7 +1583,7 @@
             elif status == 'D':
                 removed.append(f)
 
-        deleted = unknown = ignored = clean = []
+        deleted, unknown, ignored, clean = [], [], [], []
         return dirstate.status(modified, added, removed, deleted, unknown,
                                ignored, clean)
 


More information about the Mercurial-devel mailing list