Fri, 04 Mar 2022 10:28:46 +0900 chgserver: remove Python 2 file descriptor logic
Yuya Nishihara <yuya@tcha.org> [Fri, 04 Mar 2022 10:28:46 +0900] rev 48951
chgserver: remove Python 2 file descriptor logic Follows up 0bb28b7736bc "chgserver: remove Python 2 support code." On Python 2, we had to close newfp prior to restoring the original file description since "delete newfp" would otherwise close the file descriptor shared with the long-lived fp: in attachio(): newfp = os.fdopen(fp.fileno(), mode, bufsize) in _restoreio(): newfp.close() # temporarily close newfp.fileno() (= fp.fileno()) os.dup2(fd, fp.fileno()) # reopen fp.fileno() with original fd On the other hand, we shouldn't call newfp.close() on Python 3 since any function calls are proxied to the underlying file object by procutil.LineBufferedWrapper.
Tue, 08 Feb 2022 15:51:52 +0100 dirstate-tree: optimize HashMap lookups with raw_entry_mut
Simon Sapin <simon.sapin@octobus.net> [Tue, 08 Feb 2022 15:51:52 +0100] rev 48950
dirstate-tree: optimize HashMap lookups with raw_entry_mut This switches to using `HashMap` from the hashbrown crate, in order to use its `raw_entry_mut` method. The standard library’s `HashMap` is also based on this same crate, but `raw_entry_mut` is not yet stable there: https://github.com/rust-lang/rust/issues/56167 Using version 0.9 because 0.10 is yanked and 0.11 requires Rust 1.49 This replaces in `DirstateMap::get_or_insert_node` a call to `HashMap<K, V>::entry` with `K = WithBasename<Cow<'on_disk, HgPath>>`. `entry` takes and consumes an "owned" `key: K` parameter, in case a new entry ends up inserted. This key is converted by `to_cow` from a value that borrows the `'path` lifetime. When this function is called by `Dirstate::new_v1`, `'path` is in fact the same as `'on_disk` so `to_cow` can return an owned key that contains `Cow::Borrowed`. For other callers, `to_cow` needs to create a `Cow::Owned` and thus make a costly heap memory allocation. This is wasteful if this key was already present in the map. Even when inserting a new node this is typically the case for its ancestor nodes (assuming most directories have numerous descendants). Differential Revision: https://phab.mercurial-scm.org/D12317
Fri, 04 Mar 2022 13:33:55 +0100 heptapod-ci: remove useless mentions of Python 3
Raphaël Gomès <rgomes@octobus.net> [Fri, 04 Mar 2022 13:33:55 +0100] rev 48949
heptapod-ci: remove useless mentions of Python 3 Now that we don't have Python 2 jobs, we can go with shorter names. Differential Revision: https://phab.mercurial-scm.org/D12354
Fri, 04 Mar 2022 13:01:13 -0800 revlog: remove unused `rank` variable from D12209
Martin von Zweigbergk <martinvonz@google.com> [Fri, 04 Mar 2022 13:01:13 -0800] rev 48948
revlog: remove unused `rank` variable from D12209 Differential Revision: https://phab.mercurial-scm.org/D12355
Mon, 21 Feb 2022 13:10:22 -0700 demandimport: delete demandimportpy2 module
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 21 Feb 2022 13:10:22 -0700] rev 48947
demandimport: delete demandimportpy2 module We no longer support Python 2. Differential Revision: https://phab.mercurial-scm.org/D12353
Mon, 21 Feb 2022 13:08:28 -0700 py3: use class X: instead of class X(object):
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 21 Feb 2022 13:08:28 -0700] rev 48946
py3: use class X: instead of class X(object): The inheritance from object is implied in Python 3. So this should be equivalent. This change was generated via an automated search and replace. So there may have been some accidental changes. Differential Revision: https://phab.mercurial-scm.org/D12352
Mon, 21 Feb 2022 13:03:43 -0700 check-code: remove ban on old-style classes
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 21 Feb 2022 13:03:43 -0700] rev 48945
check-code: remove ban on old-style classes In Python 3, `class foo:` is equivalent to `class foo(object):`. So we can allow the former form now. Differential Revision: https://phab.mercurial-scm.org/D12351
Mon, 21 Feb 2022 12:46:27 -0700 tests: remove Python 2 support code
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 21 Feb 2022 12:46:27 -0700] rev 48944
tests: remove Python 2 support code Differential Revision: https://phab.mercurial-scm.org/D12350
Mon, 21 Feb 2022 12:44:41 -0700 tests: remove Python < 3 check
Gregory Szorc <gregory.szorc@gmail.com> [Mon, 21 Feb 2022 12:44:41 -0700] rev 48943
tests: remove Python < 3 check We require Python 3 now. Differential Revision: https://phab.mercurial-scm.org/D12349
Tue, 01 Mar 2022 20:53:52 -0800 cborutil: remove Python 2 definition of _elementtointeger()
Gregory Szorc <gregory.szorc@gmail.com> [Tue, 01 Mar 2022 20:53:52 -0800] rev 48942
cborutil: remove Python 2 definition of _elementtointeger() Differential Revision: https://phab.mercurial-scm.org/D12348
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 tip