localrepo: have stream_in() not modify its argument
authorDrew Gottlieb <drgott@google.com>
Wed, 22 Apr 2015 12:59:12 -0700
changeset 24916 658bd4dc7a73
parent 24915 1c40408770f7
child 24917 71a738a6a1c1
localrepo: have stream_in() not modify its argument Localrepo's stream_in function modified its requirements argument. This is not good practice because it may be unexpected behavior to the caller.
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Wed Apr 22 12:06:44 2015 -0700
+++ b/mercurial/localrepo.py	Wed Apr 22 12:59:12 2015 -0700
@@ -1827,8 +1827,8 @@
             # new requirements = old non-format requirements +
             #                    new format-related
             # requirements from the streamed-in repository
-            requirements.update(self.requirements - self.supportedformats)
-            self.requirements = requirements
+            self.requirements = requirements | (
+                    self.requirements - self.supportedformats)
             self._applyopenerreqs()
             self._writerequirements()