[PATCH 03 of 17 V4] dirstate: create class for status lists
Matt Mackall
mpm at selenic.com
Tue Oct 14 00:51:08 CDT 2014
On Sat, 2014-10-11 at 22:44 -0700, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz at gmail.com>
> # Date 1412976756 25200
> # Fri Oct 10 14:32:36 2014 -0700
> # Node ID cd8ad3e2855507f93bc5a2fb645806c22be7b946
> # Parent 7309c75e96a9a2f6d0e0f796a4d13e595e9ea958
> dirstate: create class for status lists
>
> Callers of various status() methods (on dirstate, context, repo) get a
> tuple of 7 elements, where each element is a list of files. This
> results in lots of uses of indexes where names would be much more
> readable. For example, "status.ignored" seems clearer than "status[4]"
> [1]. So, let's introduce a simple named tuple containing the 7 status
> fields: modified, added, removed, deleted, unknown, ignored, clean.
>
> This patch introduces the class and updates the status methods to
> return instances of it. Later patches will update the callers.
>
> [1] Did you even notice that it should have been "status[5]"?
To move things along, I've tweaked this a bit in flight:
- I've put the class definition in scmutil as status is not actually
specific to the working copy (and I don't want to have a bunch of new
things importing dirstate)
- I've put _only_ the single change to dirstate.status() in that
changeset, which:
- gives a smaller patch with fewer distractions
- proves API compatibility by introducing no test changes
- I've put all the other users in a separate patch
--
Mathematics is the supreme nostalgia of our time.
More information about the Mercurial-devel
mailing list