# HG changeset patch # User Sean Farley # Date 2014-05-27 22:04:48 # Node ID 0a8e7f81e8ae199d75241755534038f8201ae12c # Parent 609a642dff61b3cb226e2bc0e535cfd9f4dd7ba9 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. diff --git a/mercurial/context.py b/mercurial/context.py --- a/mercurial/context.py +++ b/mercurial/context.py @@ -326,7 +326,9 @@ class basectx(object): 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 @@ class workingctx(committablectx): 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