Jason R. Coombs <jaraco@jaraco.com> [Wed, 02 Nov 2022 09:34:03 -0400] rev 49729
demandimport: ensure lazyloaderex sets loader attributes (issue6725)
Adds test capturing missed expectation.
Jason R. Coombs <jaraco@jaraco.com> [Tue, 30 Aug 2022 09:59:53 -0400] rev 49728
shelve: add test for Shelf.changed_files
Jason R. Coombs <jaraco@jaraco.com> [Mon, 29 Aug 2022 14:11:26 -0400] rev 49727
shelve: add Shelf.changed_files for resolving changed files in a plugin
Raphaël Gomès <rgomes@octobus.net> [Mon, 14 Nov 2022 10:59:09 +0100] rev 49726
branching: merge stable into default
Mathias De Mare <mathias.de_mare@nokia.com> [Mon, 07 Nov 2022 09:25:20 +0100] rev 49725
configitems: enable pullbundles by default
The use of pullbundles is already protected: they are only used
when a pullbundles.manifest file is created on the server.
Having an additional flag doesn't really make sense
and can confuse users (as indicated in the mercurial mailing list
on the topic "Can't get pull-bundles working").
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Nov 2022 22:59:16 -0400] rev 49724
typing: add basic type hints to stringutil.py
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Nov 2022 17:54:43 -0400] rev 49723
vfs: make the default opener mode binary
The default was already binary for `abstractvfs`, and the `vfs` implementation
adds binary mode if the caller didn't supply it. Therefore, it should be safe
for all vfs objects (and I don't think we want text reads anyway).
Matt Harbison <matt_harbison@yahoo.com> [Wed, 02 Nov 2022 17:30:57 -0400] rev 49722
typing: add basic type hints to vfs.py
Again, there's a lot more that could be done, but this sticks to the obviously
correct stuff that is related to primitives or `vfs` objects. Hopefully this
helps smoke out more path related bytes vs str issues in TortoiseHg.
PyCharm seems smart enough to apply hints from annotated superclass functions,
but pytype isn't (according to the *.pyi file generated), so those are annotated
too.
There was some discussion about changing the default path arg from `None` to
`b''` in order to avoid the more verbose `Optional` declarations. This would be
more in line with `os.path.join()` (which rejects `None`, but ignores empty
strings), and still not change the behavior for callers still passing `None`
(because the check is `if path` instead of an explicit check for `None`). But I
didn't want to hold this up while discussing that, so this documents what _is_.
Matt Harbison <matt_harbison@yahoo.com> [Fri, 04 Nov 2022 17:35:44 -0400] rev 49721
util: implement `writelines()` on atomictempfile
With typehints on the vfs objects, pytype will flag this:
FAILED: /mnt/c/Users/Matt/hg/.pytype/pyi/mercurial/patch.pyi
/usr/bin/python3.8 -m pytype.single
--imports_info /mnt/c/Users/Matt/hg/.pytype/imports/mercurial.patch.imports
--module-name mercurial.patch -V 3.7
-o /mnt/c/Users/Matt/hg/.pytype/pyi/mercurial/patch.pyi
--analyze-annotated --nofail --quick
/mnt/c/Users/Matt/hg/mercurial/patch.py
File "/mnt/c/Users/Matt/hg/mercurial/patch.py", line 535, in writerej:
No attribute 'writelines' on mercurial.util.atomictempfile [attribute-error]
In Union[
mercurial.util.atomictempfile,
mercurial.vfs.checkambigatclosing,
mercurial.vfs.delayclosedfile,
mercurial.windows.fdproxy,
mercurial.windows.mixedfilemodewrapper
]
It's not a real problem there (atomictempfile is only created by passing
different args), but it's reasonable for this to implement the function and
behave like a normal file. There are other functions missing that can be added
if/when needed.
Matt Harbison <matt_harbison@yahoo.com> [Wed, 02 Nov 2022 16:43:01 -0400] rev 49720
typing: add basic type hints to localrepo.py
There's a lot more that could be done, but this sticks to the obviously correct
stuff that is either related to existing imports or primitives. Hopefully this
helps smoke out more path related bytes vs str issues in TortoiseHg.
I'm avoiding the interfaces for now, because they seem to confuse pytype and/or
PyCharm. It might be worth typing the return of `makelocalrepository` to
`localrepository`, but that leaks an implementation detail, so that can be
revisited later.