repair: preserve phase also when not using generaldelta (
issue5678)
It seems like we used to pick the oldest possible version of the
changegroup to use for bundles created by the repair module (used
e.g. by "hg strip" and for temporary bundles by "hg rebase"). I tried
to preserve that behavior when I created the changegroup.safeversion()
method in
3b2ac2115464 (changegroup: introduce safeversion(),
2016-01-19).
However, we have recently chagned our minds and decided that these
commands are only used locally and downgrades are unlikely. That
decicion allowed us to start adding obsmarker and phase information to
these bundles. However, as the bug report shows, it means we get
different behavior e.g. when generaldelta is not enabled (because when
it was enabled, it forced us to use bundle2). The commit that actually
caused the reported bug was
8e3021fd1a44 (strip: include phases in
bundle (BC), 2017-06-15).
So, since we now depend on having more information in the bundles,
let's make sure we instead pick the newest possible changegroup
version.
Differential Revision: https://phab.mercurial-scm.org/D715
tests: add test for
issue5678
In addition to a test case for the direct problem described in the bug
report, this also adds a test case showing how obsmarkers can also get
lost when not using generaldelta.
Differential Revision: https://phab.mercurial-scm.org/D714
merge: move cwd-missing detection to helper functions
This will exist in two places with defered writes, so we want to avoid
duplication.
Differential Revision: https://phab.mercurial-scm.org/D626
doctest: enable tests by default on Python 3
Still several tests fail mostly because of the string issues, sigh. I'll
fix them one by one.
doctest: normalize b'', u'' and exception output on Python 3
The idea is described in the following page.
https://dirkjan.ochtman.nl/writing/2014/07/06/single-source-python-23-doctests.html
# no-check-commit
doctest: coerce dict.keys() to list
Otherwise it would be printed as odict_keys([...]) on Python 3.