commit: reduce scope of 'removed' variable

The variable is closely related to 'added' and 'changed', so it makes
sense to have it declared next to them.

--HG--
extra : amend_source : bfc95c1ad10adbaf1f3fd80cf209b16cbd83c425
commit: remove dead initialization of 'lock'

The 'lock' variable is initialized to None, but before it's ever read,
it's assigned again.
commit: use separate variable for p1 manifest and new manifest

In localrepo.commitctx(), p1's manifest is copied and used as the
basis for the manifest that is about to be committed. The way the copy
is updated makes it safe to use it where the original p1's manifest is
wanted. For readability, though, a separate variable for each purpose
would be clearer. Make it so.
commit: update file nodeid and flags in the same place

Now that we have a separate variable for the original 'm1' manifest,
we can safely update the nodeid of the file in the new manifest in the
same place as we update the flags.
dirstate: separate 'lookup' status field from others

The status tuple returned from dirstate.status() has an additional
field compared to the other status tuples: lookup/unsure. This field
is just an optimization and not something most callers care about
(they want the resolved value of 'modified' or 'clean'). To prepare
for a single future status type, let's separate out the 'lookup' field
from the rest by having dirstate.status() return a pair: (lookup,
status).
lfutil: avoid creating unnecessary copy of status tuple

In lfdirstatestatus(), the status tuple gets deconstructed, the lists
get updated, and then an identical status tuple gets created and
returned. Change it so we simply return the original tuple.
status: 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]"?

(tweaked by mpm to introduce the class in scmutil and only change one user)

--HG--
extra : amend_source : e57cbe93f1fcad722c63349181dccff880f85076
status: update various other methods to return new class

--HG--
extra : rebase_source : edb56c785a268108088b923224afb15863fc5f39
extra : amend_source : d6c92a6dc0be27dd700e661cd890f3f113d34997
status: update and move documentation of status types to status class

The various status types are currently documented on the
dirstate.status() method. Now that we have a class for the status
types, it makese sense to document the status types there
instead. Only leave the bits related to lookup/unsure in the status()
method documentation.

--HG--
extra : rebase_source : cfcc126880a8b592476090b6933d380a2d458110
context: store status class instead of plain tuple in self._status

This improves readability a bit by allowing us to refer to statuses by
name rather than index.

--HG--
extra : rebase_source : c14145884c8669f5d9199e05048028a45e30b120
hgcia: access status fields by name rather than index

--HG--
extra : rebase_source : 79fed27d93110f03aaa19ced3a91298fa2b8d44e
keyword: access status fields by name rather than index

--HG--
extra : rebase_source : 4dde0667ff2adf2f0a150846c4e1ae5837f38453
largefiles: access status fields by name rather than index

--HG--
extra : rebase_source : 1cbd456950f7bbb9a81e15131dae87d7811cd8f1
purge: access status fields by name rather than index

--HG--
extra : rebase_source : 905c77a80863be3add2fb5683958b107e1bab0a4
record: access status fields by name rather than index

It is safe to pass the full status to patch.diff() since it does its
own slicing.

--HG--
extra : rebase_source : 29c74b873dc73118468c8ffdda61e2500342013a
shelve: access status fields by name rather than index

--HG--
extra : rebase_source : e8f87ed31bf943801d393ba8f567a8dc0da6e2b9
histedit: access status fields by name rather than index

--HG--
extra : rebase_source : 3ac364e77d0fb51c55189cf914595cb874c5211a
fileset: access status fields by name rather than index

--HG--
extra : rebase_source : 525ec4d19c68115be6ba245c4c128854ccf31d0f
strip: make checklocalchanges() return full status tuple

By making checklocalchanges() return the full instance of the status
class instead of just the first 4 elements of it, we can take
advantage of the field names and not require the caller to remember
the element indices.

--HG--
extra : rebase_source : 27a7fd49c328a34a44d8d6f9756d921e714f4d96
summary: make status code more readable

In commands.summary(), we currently zip a list of labels with a list
of statuses. This means the order of the status list has to match the
list of the labels, which in turn means the status elements have to be
inserted into specific places in the list. Let's instead group the
labels and status data we want to display in a single list of pairs.

--HG--
extra : rebase_source : ebf541b5841fca8e2f5cdf52741e58714ae8490e