tests: use 'legacy.exchange' option in various mixed tests
The new option will stay around. The experimental option was only meant to be
temporary. We update various tests that validate both bundle1 and bundle2
version side by side. This changeset only takes care of enforcing bundle1. The
other use of 'experimental.bundle2-exp=True' will be taken care of in the next
changeset.
tests: use 'legacy.exchange' option in various bundle1 tests
The new option will stay around. The experimental option was only meant to be
temporary.
tests: use 'legacy.exchange' option in 'test-bundle2-exchange.t'
The new option will stay around. The experimental option was only meant to be
temporary.
bundlerepo: also read the 'devel.legacy.exchange' config
Bundlerepo does its own bundle2 related logic.
bundle2: add a devel option controling bundle version used for exchange
We need an official way to force bundle1 to be used in test. We introduce a new
option 'devel.legacy.exchange' to control this. When specified, this option
will control the list of bundle version Mercurial consider when exchanging with
a peer. Current valid value are 'bundle1' and 'bundle2'.
Using this option in all tests will allow us to remove the
'experimental.bundle2-exp' option. We will simplify the code once the
experimental option is dropped.
bundle2: rename the _canusebundle2 method to _forcebundle1
We rename and invert the logic of the _canusebundle2 utility. The idea here is
that we need to have a way to enforce the use of bundle1 in the tests. The
Mercurial philosophy is to try to use the best method available. Currently that
best method is bundle2, but this might change in the future. Therefore expressing
"do not use bundle2" is a loosy way to say "use bundle 1" and will likely create
issue in the future. As the config option will be explicitly about bundle1, we
rename the function beforehand to align with this. This will make the life of a
future developer working on bundle3 easier.
tests: remove bundle2 activation from test-bookmark-pushpull.t
This is an old config that predate bundle2 on by default. This should have been
remove after Mercurail 3.6 got released.
tests: update bugzilla link in test-
issue1175.t
formatter: add function to convert list to appropriate format (
issue5217)
Before, it wasn't possible for formatter to handle array structure other
than date tuple. We've discussed that at the last sprint, which ended we
would probably want to allow only templatable data structure, i.e. a list
of dicts:
data(tags=[{'tag': a}, {'tag': b}, ...])
Unfortunately, it turned out not working well with template functions:
"{ifcontains(a, tags, ...)}"
^^^^^^^^^^^^^^^^^^
"a in tags", where tags should be a plain list/set of tags
So the formatter must at least know if the type [{}] was constructed from
a plain list or was actually a list of dicts.
This patch introduces new explicit interface to convert an array structure
to an appropriate data type for the current formatter, which can be used
as follows:
fm.write('tags', _('tags: %s\n'), fm.formatlist(tags, name='tag'))
No separate fm.data() call should be necessary.