copies: add config option for writing copy metadata to file and/or changset
This introduces a config option that lets you choose to write copy
metadata to the changeset extras instead of to filelog. There's also
an option to write it to both places. I imagine that may possibly be
useful when transitioning an existing repo.
The copy metadata is stored as two fields in extras: one for copies
since p1 and one for copies since p2.
I may need to add more information later in order to make copy tracing
faster. Specifically, I'm thinking out recording which files were
added or removed so that copies._chaincopies() doesn't have to look at
the manifest for that. But that would just be an optimization and that
can be added once we know if it's necessary.
I have also considered saving space by using replacing the destination
file path by an index into the "files" list, but that can also be
changed later (but before the feature is ready to release).
Differential Revision: https://phab.mercurial-scm.org/D6183
#require docutils
#require gettext
Test document extraction
$ HGENCODING=UTF-8
$ export HGENCODING
$ { echo C; ls "$TESTDIR/../i18n"/*.po | sort; } | while read PO; do
> LOCALE=`basename "$PO" .po`
> echo "% extracting documentation from $LOCALE"
> LANGUAGE=$LOCALE "$PYTHON" "$TESTDIR/../doc/gendoc.py" >> gendoc-$LOCALE.txt 2> /dev/null || exit
>
> if [ $LOCALE != C ]; then
> if [ ! -f $TESTDIR/test-gendoc-$LOCALE.t ]; then
> echo missing test-gendoc-$LOCALE.t
> fi
> cmp -s gendoc-C.txt gendoc-$LOCALE.txt && echo "** NOTHING TRANSLATED ($LOCALE) **"
> fi
> done; true
% extracting documentation from C
% extracting documentation from da
% extracting documentation from de
% extracting documentation from el
% extracting documentation from fr
% extracting documentation from it
% extracting documentation from ja
% extracting documentation from pt_BR
% extracting documentation from ro
% extracting documentation from ru
% extracting documentation from sv
% extracting documentation from zh_CN
% extracting documentation from zh_TW