Re: pycompat.py strategy

2022-03-01 Thread Gregory Szorc
On Tue, Mar 1, 2022 at 5:08 AM Joerg Sonnenberger wrote: > Am Tue, Mar 01, 2022 at 11:20:41AM +0100 schrieb Raphaël Gomès: > > > > On 2/22/22 23:06, Joerg Sonnenberger wrote: > > > Am Mon, Feb 21, 2022 at 11:47:36AM -0700 schrieb Gregory Szorc: > > > > Some options: > > > > > > > > a) Attempt to

D12255: tests: remove from __future__ from inline Python in tests

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: durin42. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is no longer required since we require Python 3 and the linter no longer requires these statements. REPOSITORY rHG

D12258: py2: drop some more from __future__ statements

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY These are no longer needed after dropping support for Python 2. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12253: tests: remove output conditionalized on no-py3

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY I simply did a search for `^.* \(no-py3 !\)\n` and removed all matched lines. There are still some references to no-py3. But these were the simpler ones to

D12249: py3: use pickle directly

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: durin42. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY pycompat.pickle abstracted over the different pickle modules in Python 2 and 3. Now that we're Python 3 only, it is safe to

D12257: tests: delete some no-py3 blocks

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY And drop some nearby avoidable py3 checks in close proximity while we are here. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12256: tests: remove __future__ import from test-debugcommands.t

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This one is slightly more involved since it affects test output. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12252: py3: use io.BytesIO directly

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added subscribers: mercurial-patches, Kwan. Herald added a reviewer: hg-reviewers. REVISION SUMMARY Previously, pycompat.bytesio and pycompat.stringio referred to io.BytesIO. And util.bytesio and util.stringio aliased the pycompat symbols. This

D12254: py2: remove simple from __future__ statements

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: durin42. Herald added a reviewer: durin42. Herald added a reviewer: martinvonz. Herald added a reviewer: martinvonz. Herald added subscribers: mercurial-patches, Kwan. Herald added a reviewer: hg-reviewers. REVISION SUMMARY These were

D12248: thirdparty: delete concurrent.futures

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Now that we require Python 3 we no longer need this library as the functionality provided by the standard library is sufficient. REPOSITORY rHG Mercurial

D12250: pycompat: remove large Python 2 block

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We no longer support Python 2. So we can delete its compatibility code and remove the conditional and dedent the Python 3 code. In order to make the

D12251: check-py3-compat: drop support for Python 2

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We no longer support Python 2 so we can drop support for linting code for Python 2 support. This gets rid of the check for `from __future__`, enabling us

D12247: pycompat: remove first not ispy3 block

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We now require Python 3. So we can remove the first block supporting Python 2. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12246: import-checker: assume absolute and use modern import checker

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Since we require Python 3 now, we can assume we always use absolute imports and the modern import checker should be used. REPOSITORY rHG Mercurial BRANCH

D12244: tests: remove last references to PYTHON3

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This removes the last references to PYTHON3. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12244 AFFECTED

D12245: tests: unconditionalize some imports

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Now that we require Python 3 we can simplify these imports. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12243: tests: simplify Windows and PYTHON3 conditionals

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY PYTHON3 is always True. So this flow can be reduced. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12243

D12242: tests: delete some not PYTHON3 blocks

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY These can never be used anymore. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12242 AFFECTED FILES

D12241: tests: unconditionalize _bytes2sys()

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY As part of requiring Python 3. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12241 AFFECTED FILES

D12239: tests: always encode session

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12239 AFFECTED FILES tests/run-tests.py CHANGE DETAILS diff --git

D12238: tests: unconditionalize bchr

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We could probably just do bytes([x]) everywhere. But this eliminates use of PYTHON3. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12240: tests: remove Python 3 conditionalizing from variables

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12240 AFFECTED FILES tests/run-tests.py CHANGE DETAILS diff --git

D12237: tests: unconditionalize _unified_diff

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Now that we're Python 3 only we can make this logic simpler. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12236: tests: collapse elif PYTHON3 block

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY PYTHON3 is always True now so this logic should be identical as to before. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12235: tests: collapse some more trivial if PYTHON3 blocks

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This doesn't account for all of the references to PYTHON3. But it accounts for the ones that are more trivial and don't entail logical changes. REPOSITORY

D12234: tests: require Python 3.5+ in run-tests.py

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We change the version check logic to hard fail if running on <= 3.5.0. The branch for <3.5 has been deleted. And the >=3.5 branch block has been dedented.

D12218: black: blacken with 22.1.0

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY black 22.1.0 is the first non-beta release of black. I think it makes sense for us to adopt this version of black. This commit blackens the repo with

D12232: cext: remove PY23()

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Since we always run on Python 3 now, we no longer need this macro to support Python 2. We refactor all users to just use the 2nd argument. REPOSITORY rHG

D12233: cext: remove inline rewriting of argv

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This only worked on Python 2. And since we dropped support for Python 2, we can drop support for this functionality. REPOSITORY rHG Mercurial BRANCH

D12231: cext: unconditionalize PySlice_GetIndicesEx()

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We only support Python 3 now. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12231 AFFECTED FILES

D12229: cext: use PyLong symbols

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We no longer support Python 2. So we can unconditionally use the Python 3 symbol names. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12230: cext: unconditionalize PYLONG_VALUE()

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We only support Python 3 now. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12230 AFFECTED FILES

D12228: cext: use PyLong symbols

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We no longer need to support Python 2. So use the Python 3 symbol names directly. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12221: cext: remove Python 2 module initializer functions

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We no longer need these since we dropped support for Python 2. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12227: cext: remove Python 2 support

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We still alias the Python 2 symbols. This will be cleaned up in a separate commit. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12226: cext: remove Python 2 file handling code

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12226 AFFECTED FILES mercurial/cext/osutil.c CHANGE DETAILS diff --git

D12225: cext: remove Python 2 variant of listdir_slot()

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12225 AFFECTED FILES mercurial/cext/osutil.c CHANGE DETAILS diff --git

D12224: cext: remove some conditional preprocessor defines

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We may want to inline these defines. But for now, getting rid of the Python 2 support is a step forward. REPOSITORY rHG Mercurial BRANCH default

D12223: cext: unconditionally use PyLong_FromLong()

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We no longer support Python 2. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D12223 AFFECTED FILES

D12222: cext: drop preprocessor PyInt aliases

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Now that we dropped support for Python 2 we can use the Python 3 native functions. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL

D12220: tests: require black 22.1.0

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We recently reformatted the repo with black 22.1.0. Since black 22.1.0 is the first non-beta release of black and black is committed to keeping the style

D12219: automation: upgrade black to 22.1.0

2022-03-01 Thread indygreg (Gregory Szorc)
indygreg created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We just reformatted the repo with black 22.1.0. Let's install this version of black in the Linux automation. REPOSITORY rHG Mercurial BRANCH default

Re: Python 3.x version support / dropping 3.5 and 3.6

2022-03-01 Thread Raphaël Gomès
On 2/27/22 22:19, Gregory Szorc wrote: 6.1 will be the last release to support Python 2.7. That means 6.2 will be Python 3 only. Currently our Python 3 support is for 3.5-3.10. Python 3.5 dropped out of support in September 2020 and Python 3.6 in December 2021

mercurial@48808: 6 new changesets (5 on stable)

2022-03-01 Thread Mercurial Commits
6 new changesets (5 on stable) in mercurial: https://www.mercurial-scm.org/repo/hg/rev/60950aef856c changeset: 48803:60950aef856c branch: stable user:Raphaël Gomès date:Fri Feb 18 13:14:32 2022 +0100 summary: relnotes: add 6.0.3

Re: pycompat.py strategy

2022-03-01 Thread Joerg Sonnenberger
Am Tue, Mar 01, 2022 at 11:20:41AM +0100 schrieb Raphaël Gomès: > > On 2/22/22 23:06, Joerg Sonnenberger wrote: > > Am Mon, Feb 21, 2022 at 11:47:36AM -0700 schrieb Gregory Szorc: > > > Some options: > > > > > > a) Attempt to delete as much as pycompat.py as possible (leaving only the > > >

Re: pycompat.py strategy

2022-03-01 Thread Raphaël Gomès
On 2/22/22 23:06, Joerg Sonnenberger wrote: Am Mon, Feb 21, 2022 at 11:47:36AM -0700 schrieb Gregory Szorc: Some options: a) Attempt to delete as much as pycompat.py as possible (leaving only the pieces needed to abstract over differences in Python 3.5-3.x). b) Leave the ~complete API

D12217: merge: remove direct rustmod reference

2022-03-01 Thread Raphaël Gomès
Alphare created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We shouldn't rely on this member being present in `dirstate.py`, this creates unnecessary coupling. This also can trigger certain issues in edge-cases where