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

login
register
mail settings
Submitter Martin von Zweigbergk
Date Oct. 12, 2014, 5:44 a.m.
Message ID <ff2b1774db604583e71c.1413092674@handduk2.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/6233/
State Accepted
Headers show

Comments

Martin von Zweigbergk - Oct. 12, 2014, 5:44 a.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@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.

Patch

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)