changeset 24916:658bd4dc7a73

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.
author Drew Gottlieb <drgott@google.com>
date Wed, 22 Apr 2015 12:59:12 -0700
parents 1c40408770f7
children 71a738a6a1c1
files mercurial/localrepo.py
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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()