D10198: rebase: inline simple function for finding obsolete subset of commits

2021-03-12 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY `_filterobsoleterevs()` is just one line long. It was introduced in 2d294dada4f8

D10197: amend: mark commit obsolete after moving working copy

2021-03-12 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY We were doing it this way: 1. move working copy (repo.setparents) 2. add obsmarkers (scmutil.cleanupnodes) 3. fix dirstate (dirstate.normal/drop)

Failed pipeline for branch/default | mercurial-devel | 7cc7820f

2021-03-12 Thread Heptapod
Pipeline #19277 has failed! Project: mercurial-devel ( https://foss.heptapod.net/octobus/mercurial-devel ) Branch: branch/default ( https://foss.heptapod.net/octobus/mercurial-devel/-/commits/branch/default ) Commit: 7cc7820f (

D10195: run-test: install rhg if --rhg is passed

2021-03-12 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Before this, --rhg was only working with --local. REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D10195

D10190: tests: Disable for rhg remaining tests that fail in that mode

2021-03-12 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY These cases are in features not yet implemented by rhg for which triggering a fallback is not practical. Disabling some tests allows us to reach passing

D10196: ci: Add a job testing with rhg installed as `hg`

2021-03-12 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This significantly increases test coverage of rhg, without duplicating many tests that already exist. REPOSITORY rHG Mercurial BRANCH default REVISION

D10189: rhg: Remove `rhg.fallback-executable=hg` default configuration

2021-03-12 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY When `rhg.on-unsupported` is configured to `fallback` and an unsupported feature is encountered, the previous default was to look for an `hg` executable in

D10193: makefile: add a build-rhg option

2021-03-12 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This gives an easy action to build the rhg-binary. This will be useful for the `install-rhg` action in the next changeset. REPOSITORY rHG Mercurial

D10194: makefile: add a install option

2021-03-12 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This gives and easy way to install rhg that we can use in `run-test.py` in the next changesets. REPOSITORY rHG Mercurial BRANCH default REVISION

D10192: makefile: add a install-chg option

2021-03-12 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is done as a gratuitous improvement on the way to add makefile entry to build and install rhg. It seems saner to have equivalent entry for chg too.

D10191: makefile: add a build-chg option

2021-03-12 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This is done as a gratuitous improvement on the way to add makefile entry to build and install rhg. It seems saner to have equivalent entry for chg too.

D10188: rhg: Add an allow-list of ignored extensions

2021-03-12 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Because rhg doesn’t know how a Python extension would affect behavior it implements in Rust, when an unsupported extension is enabled it conservatively

D10187: tests: Enable rhg fallback to Python by default in tests

2021-03-12 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This premise of `run-tests.py --rhg`: fallback should make `rhg` behave the same as `hg`, except faster in some cases. To test run the whole test suite

D10186: rhg: Add environment variables for fallback configuration

2021-03-12 Thread SimonSapin
SimonSapin created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY For the `rust-tests.py --rhg` we want every `hg` command in tests to run `rhg` with fallback enabled, but other methods of setting configuration are

Failed pipeline for branch/default | mercurial-devel | 7cc7820f

2021-03-12 Thread Heptapod
Pipeline #19277 has failed! Project: mercurial-devel ( https://foss.heptapod.net/octobus/mercurial-devel ) Branch: branch/default ( https://foss.heptapod.net/octobus/mercurial-devel/-/commits/branch/default ) Commit: 7cc7820f (

D10185: black: merge config into main pyproject.toml now that we have it

2021-03-12 Thread durin42 (Augie Fackler)
durin42 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This means that naive contributors who just run `black` on a source file will get reasonable behavior as long as they have a recent black. Yay! This was

D10184: pyproject: add config file

2021-03-12 Thread durin42 (Augie Fackler)
durin42 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This will tell pip et al to call our setup.py for the majority of packaging concerns, but also gives us a place to put standard config stuff like black.

[Bug 6497] New: RFE: hg which command, that identifies where a subcommand is defined

2021-03-12 Thread mercurial-bugs
https://bz.mercurial-scm.org/show_bug.cgi?id=6497 Bug ID: 6497 Summary: RFE: hg which command, that identifies where a subcommand is defined Product: Mercurial Version: unspecified Hardware: All OS: All

D10178: patch: convert a UI message to bytes when editing a patch

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D10178 AFFECTED FILES mercurial/patch.py CHANGE DETAILS diff --git

D10182: wireprotoserver: convert ErrorResponse to bytes

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Caught by pytype: File "/mnt/c/Users/Matt/hg/mercurial/wireprotoserver.py", line 236, in handlewsgirequest: Function _bytestr.__init__ was called with

D10179: subrepo: handle unexpected file types from git gracefully

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This was flagged by pytype because `tar.extractfile(...)` can return None if the entry is not a file or symlink. I don't think that git supports other

D10183: typing: disable a module-attr warning in the worker module's py2 code

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D10183 AFFECTED FILES mercurial/worker.py CHANGE DETAILS diff --git

D10173: grep: convert an exception to bytes for a warning message

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Caught by pytype: File "/mnt/c/Users/Matt/hg/mercurial/commands.py", line 3457, in grep: Function _bytestr.__init__ was called with the wrong

D10181: verify: convert an exception to bytes before logging

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY I'm not entirely sure why this code appears to be trying to convert twice, but it was flagged by pytype: File

D10180: typing: add an assertion to the upgrade engine to help pytype

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D10180 AFFECTED FILES mercurial/upgrade_utils/engine.py CHANGE DETAILS diff

D10174: debug: convert a few exceptions to bytes before wrapping in another error

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Caught by pytype: File "/mnt/c/Users/Matt/hg/mercurial/debugcommands.py", line 2118, in debugmanifestfulltextcache: Function Abort.__init__ was called

D10177: merge: force an exception message to bytes before printing as a warning

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Caught by pytype: File "/mnt/c/Users/Matt/hg/mercurial/merge.py", line 1346, in batchremove: Function _bytestr.__init__ was called with the wrong

D10176: hg: convert an exception to bytes in the repo creation exception handler

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Caught by pytype: File "/mnt/c/Users/Matt/hg/mercurial/hg.py", line 77, in _local: Function _bytestr.__init__ was called with the wrong arguments

D10172: morestatus: convert a UI message about merge conflicts to bytes

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D10172 AFFECTED FILES mercurial/cmdutil.py CHANGE DETAILS diff --git

D10175: typing: add an assertion instead of blacklisting mercurial/extensions.py

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D10175 AFFECTED FILES mercurial/extensions.py CHANGE DETAILS diff --git

D10171: changegroup: convert a warning message to bytes

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D10171 AFFECTED FILES mercurial/changegroup.py CHANGE DETAILS diff --git

D10170: branchmap: force Exception to bytes before logging

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Here was an instance where `black` mangled the formatting so that `pytype` didn't recognize the suppression directive. But it seems that the error was

D10168: mail: convert SMTPException to bytes before passing to error.Abort()

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY Caught by pytype: File "/mnt/c/Users/Matt/hg/mercurial/mail.py", line 168, in _smtp: Function Abort.__init__ was called with the wrong arguments

D10169: nodemap: convert error message to bytes

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REPOSITORY rHG Mercurial BRANCH stable REVISION DETAIL https://phab.mercurial-scm.org/D10169 AFFECTED FILES mercurial/revlogutils/nodemap.py CHANGE DETAILS diff

D10167: typing: switch an argument type to the generic form

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY This fixes the following pytype complaint: File "/mnt/c/Users/Matt/hg/mercurial/commands.py", line 4672, in log: Function

D10166: typing: ensure that error.Abort is given bytes

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY There's a bunch more typing to be done here, but the list of things to fix is already long, and I know there are instances where this is being used

D10165: typing: fix a suppression directive that was mangled by black formatting

2021-03-12 Thread mharbison72 (Matt Harbison)
mharbison72 created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY It looks like black is moving comments needed by pytype out of position, and causing some things that should be disabled to be enforced anyway. REPOSITORY

D10164: split: close transaction in the unlikely event of a conflict while rebasing

2021-03-12 Thread martinvonz (Martin von Zweigbergk)
martinvonz created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches. REVISION SUMMARY `hg split` *should* never result in conflicts, but in case there are bugs, we should at least commit the transaction so they can continue the rebase. One