changeset 21616:0a8e7f81e8ae

context: explicitly return a tuple In the refactoring of removing localrepo.status, 2edb8648c500, we accidentally changed the return type from a tuple to a list. Philosophically, this is incorrect so we explicitly return a tuple again.
author Sean Farley <sean.michael.farley@gmail.com>
date Tue, 27 May 2014 17:04:48 -0500
parents 609a642dff61
children 0cfda08afd24
files mercurial/context.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Tue May 27 19:21:12 2014 -0700
+++ b/mercurial/context.py	Tue May 27 17:04:48 2014 -0500
@@ -326,7 +326,9 @@
 
         for l in r:
             l.sort()
-        return r
+
+        # we return a tuple to signify that this list isn't changing
+        return tuple(r)
 
 
 def makememctx(repo, parents, text, user, date, branch, files, store,
@@ -1446,8 +1448,9 @@
                                            listunknown, listsubrepos)
         # calling 'super' subtly reveresed the contexts, so we flip the results
         # (s[1] is 'added' and s[2] is 'removed')
+        s = list(s)
         s[1], s[2] = s[2], s[1]
-        return s
+        return tuple(s)
 
 class committablefilectx(basefilectx):
     """A committablefilectx provides common functionality for a file context