commands: refactor diff --stat and qdiff --stat
`opts['unified'] = '0'` can be replaced by `diffopts.context = 0`.
mq: fix opts['unified'] = '0' to take effect when qdiff --stat
`opts['unified'] = '0'` tries to reduce the number of lines to be
processed by patch.diffstat, but here it does not affect diffopts,
thus it does not make sense.
Instead, we can change `diffopts.context` directly.
Added test case for qdiff --stat.
tags: return tags in sorted order
This makes log and summary have less arbitrary tag ordering and also
groups similar tags together, such as the mq tags.
keyword: support (q)record
Monkeypatch hgext.dorecord to trigger keyword expansion.
Read data from working directory, not from filelog.
Prevent keyword expansion from within record's commitfunc,
thereby fixing a bug/inconsistency where files which are clean
after recording were overwritten twice.
keyword: remove mq commands from restricted list
Monkeypatching patch.diff takes care of this since
911f5be5d159.
Test mq more thoroughly by loosening [keywordmaps] and comparing
the output of hg cat with keyword expansion enabled and disabled.