Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(106)

Unified Diff: build/config/mac/plist_util.py

Issue 2715543002: Merge Arrays in plist_util.py (Closed)
Patch Set: update comment Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/mac/plist_util.py
diff --git a/build/config/mac/plist_util.py b/build/config/mac/plist_util.py
index e2a8d6e15eb08da22577fc0408a70b85d8af4f22..0928fa138d64aaf2937d9d8888065680661f2cdd 100644
--- a/build/config/mac/plist_util.py
+++ b/build/config/mac/plist_util.py
@@ -141,7 +141,7 @@ def MergePList(plist1, plist2):
Creates a new dictionary representing a Property List (.plist) files by
merging the two dictionary |plist1| and |plist2| recursively (only for
- dictionary values).
+ dictionary values). List value will be concatenated.
Args:
plist1: a dictionary representing a Property List (.plist) file
@@ -150,7 +150,8 @@ def MergePList(plist1, plist2):
Returns:
A new dictionary representing a Property List (.plist) file by merging
|plist1| with |plist2|. If any value is a dictionary, they are merged
- recursively, otherwise |plist2| value is used.
+ recursively, otherwise |plist2| value is used. If values are list, they
+ are concatenated.
"""
if not isinstance(plist1, dict) or not isinstance(plist2, dict):
if plist2 is not None:
@@ -165,6 +166,8 @@ def MergePList(plist1, plist2):
value = plist1[key]
if isinstance(value, dict):
value = MergePList(plist1.get(key, None), plist2.get(key, None))
+ if isinstance(value, list):
+ value = plist1.get(key, []) + plist2.get(key, [])
result[key] = value
return result
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698