Sat, 28 Mar 2020 12:18:58 -0700 pycompat: change argv conversion semantics
Gregory Szorc <gregory.szorc@gmail.com> [Sat, 28 Mar 2020 12:18:58 -0700] rev 44653
pycompat: change argv conversion semantics Use of os.fsencode() to convert Python's sys.argv back to bytes was not correct because it isn't the logically inverse operation from what CPython was doing under the hood. This commit changes the logic for doing the str -> bytes conversion. This required a separate implementation for POSIX and Windows. The Windows behavior is arguably not ideal. The previous behavior on Windows was leading to failing tests, such as test-http-branchmap.t, which defines a utf-8 branch name via a command argument. Previously, Mercurial's argument parser looked to be receiving wchar_t bytes in some cases. After this commit, behavior on Windows is compatible with Python 2, where CPython did not implement `int wmain()` and Windows was performing a Unicode to ANSI conversion on the wchar_t native command line. Arguably better behavior on Windows would be for Mercurial to preserve the original Unicode sequence coming from Python and to wrap this in a bytes-like type so we can round trip safely. But, this would be new, backwards incompatible behavior. My goal for this commit was to converge Mercurial behavior on Python 3 on Windows to fix busted tests. And I believe I was successful, as this commit fixes 9 tests on my Windows machine and 14 tests in the AWS CI environment! Differential Revision: https://phab.mercurial-scm.org/D8337
Wed, 18 Mar 2020 14:53:53 -0400 phabricator: extract logic to print the status when posting a commit
Matt Harbison <matt_harbison@yahoo.com> [Wed, 18 Mar 2020 14:53:53 -0400] rev 44652
phabricator: extract logic to print the status when posting a commit This will make it easier to list each commit when folding. That makes the output less confusing because it matches the output of `--confirm` and the revisions listed on the command line. Differential Revision: https://phab.mercurial-scm.org/D8313
(0) -30000 -10000 -3000 -1000 -300 -100 -30 -10 -2 +2 +10 +30 +100 +300 +1000 +3000 tip