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

Unified Diff: recipe_engine/third_party/google/protobuf/internal/containers.py

Issue 2236673002: Bump vendoring, move to proto3 release. (Closed) Base URL: https://github.com/luci/recipes-py@master
Patch Set: Created 4 years, 4 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
Index: recipe_engine/third_party/google/protobuf/internal/containers.py
diff --git a/recipe_engine/third_party/google/protobuf/internal/containers.py b/recipe_engine/third_party/google/protobuf/internal/containers.py
index 97cdd848e34d8da4083abb512b7403686ddec91f..ce46d08c9eca71ccddac3df8c7a6958d40e4505c 100644
--- a/recipe_engine/third_party/google/protobuf/internal/containers.py
+++ b/recipe_engine/third_party/google/protobuf/internal/containers.py
@@ -594,7 +594,11 @@ class MessageMap(MutableMapping):
def MergeFrom(self, other):
for key in other:
- self[key].MergeFrom(other[key])
+ # According to documentation: "When parsing from the wire or when merging,
+ # if there are duplicate map keys the last key seen is used".
+ if key in self:
+ del self[key]
+ self[key].CopyFrom(other[key])
# self._message_listener.Modified() not required here, because
# mutations to submessages already propagate.

Powered by Google App Engine
This is Rietveld 408576698