commit: try hard to reuse p1 manifest if nothing changed
This is all for commit reproducibility on "hg convert".
With this change, p1 manifest is reused if ctx.files() *to be committed* is
empty, and if new manifest entry is identical to p1. This is important
property for "hg convert" since memctx.files() built from a convert source
may be either a) more narrowed thanks to a committed ctx.files() which
provides more accurate status, or b) containing redundant files because of
sloppy filtering on e.g. octopus merge.
merge: add tests for commit with no content change
It isn't easy to say when to reuse the p1 manifest. Basically, that's only
when wctx.files() is empty, but we need to know that wctx.files() is not
the same as repo['.'].files() after the commit.
This patch adds several examples of commits with empty ctx/wctx.files().
I don't think this is exhaustive, but it contains at least one failure
mode in which a converted repo result in a different hash.
I also note that the manifest revlog does NOT follow the DAG shape of the
changelog since p1 manifest is reused if wctx.files() is empty even at merge.
I don't know whether it is intentional or not, but it's the behavior since
2011,
301725c3df9a "localrepo: reuse parent manifest in commitctx if no files
have changed."
mail: pass in addr to _addressencode() in bytes
_addressencode() doesn't process a unicode addr well. For example,
acc.encode('ascii') would raise UnicodeEncodeError if acc was a unicode.
This patch temporarily restores the pre-
952bf3c948f0 _addressencode().
Several tests would be broken on Python 3.
mail: remove redundant bytesurl() from addrlistencode()
_addressencode() returns a bytes.
byteify-strings: prevent "__name__ == '__main__'" from being transformed
This was okay for import-time code transformer, but shouldn't be applied to
source code.