Mon, 10 Aug 2020 15:09:44 +0530 mergestate: use collections.defaultdict(dict) for _stateextras
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 10 Aug 2020 15:09:44 +0530] rev 45401
mergestate: use collections.defaultdict(dict) for _stateextras I want to use this _stateextras more in upcoming patches to store some commit time related information. Using defaultdict will help in cleaner code around checking whether a file exists or not. Differential Revision: https://phab.mercurial-scm.org/D8919
Mon, 03 Aug 2020 23:41:50 -0700 hgweb: minimize scope of a try-block in staticfile()
Martin von Zweigbergk <martinvonz@google.com> [Mon, 03 Aug 2020 23:41:50 -0700] rev 45400
hgweb: minimize scope of a try-block in staticfile() I think the exceptions are only relevant for the `os.stat()` and `open()` calls, and maybe to the `fh.read()` call. Differential Revision: https://phab.mercurial-scm.org/D8936
Mon, 03 Aug 2020 23:38:50 -0700 hgweb: ignore web.templates config when guessing mime type for static content
Martin von Zweigbergk <martinvonz@google.com> [Mon, 03 Aug 2020 23:38:50 -0700] rev 45399
hgweb: ignore web.templates config when guessing mime type for static content Frozen binaries won't have a file-system path for static content, so I'd like to remove dependence on that. From the documentation, it seems like `mimetypes.guess_type()` only cares about the suffix, so I think it should be enough to pass in just path under the `web.templates` directory. Differential Revision: https://phab.mercurial-scm.org/D8935
Sat, 22 Aug 2020 16:03:44 -0700 hgweb: let staticfile() look up path from default location unless provided
Martin von Zweigbergk <martinvonz@google.com> [Sat, 22 Aug 2020 16:03:44 -0700] rev 45398
hgweb: let staticfile() look up path from default location unless provided This reduces duplication between the two callers. Differential Revision: https://phab.mercurial-scm.org/D8934
Mon, 03 Aug 2020 22:40:05 -0700 hgweb: handle None from templatedir() equally bad in webcommands.py
Martin von Zweigbergk <martinvonz@google.com> [Mon, 03 Aug 2020 22:40:05 -0700] rev 45397
hgweb: handle None from templatedir() equally bad in webcommands.py The following paragraph is based just on my reading of the code; I have not tried to test it. Before my recent work on templates in frozen binaries, it seems both `hgwebdir_mod.py` and `webcommands.py` would pass in an empty list into `staticfile()` when running in a frozen binary. That would then result in a variable in that function (`path`) not getting bound before its first use. I then changed that without thinking in D8786 so we passed a `None` value into the function, which made it break in another way (trying to iterate over `None`). Then I tried to fix it up in D8810, but I only changed `hgwebdir_mod.py` for some reason, and it still doesn't actually work in frozen binaries (which seems fair, since was broken before my changes too). This patch just replicates the half-assed "fix" from D8810 in `webcommands.py`, so they look more similar so I can start refactoring them in the same way. Differential Revision: https://phab.mercurial-scm.org/D8933
Thu, 13 Aug 2020 10:37:25 -0700 posixworker: avoid creating workers that end up getting no work
Martin von Zweigbergk <martinvonz@google.com> [Thu, 13 Aug 2020 10:37:25 -0700] rev 45396
posixworker: avoid creating workers that end up getting no work If `workers` (the detected or configured number of CPUs) is greater than the number of work items, then some of the workers end up getting 0 work items. Let's not create such workers. Differential Revision: https://phab.mercurial-scm.org/D8927
Mon, 10 Aug 2020 21:46:47 -0700 revert: remove dangerous `parents` argument from `cmdutil.revert()`
Martin von Zweigbergk <martinvonz@google.com> [Mon, 10 Aug 2020 21:46:47 -0700] rev 45395
revert: remove dangerous `parents` argument from `cmdutil.revert()` As we found out the hard way (thanks to spectral@ for figuring it out!), `cmdutil.revert()`'s `parents` argument must be `repo.dirstate.parents()` or things may go wrong. We had an extension that passed in the target commit as the first parent. The `hg split` command from the evolve extension seems to have made the same mistake, but I haven't looked carefully. The problem is that `cmdutil._performrevert()` calls `dirstate.normal()` on reverted files if the commit to revert to equals the first parent. So if you pass in `ctx=foo` and `parents=(foo.node(), nullid)`, then `dirstate.normal()` will be called for the revert files, even though they might not be clean in the working copy. There doesn't seem to be any reason, other than a tiny performance benefit, to passing the `parents` around instead of looking them up again in `cmdutil._performrevert()`, so that's what this patch does. Differential Revision: https://phab.mercurial-scm.org/D8925
Mon, 10 Aug 2020 18:08:15 -0700 requirements: introduce a set of working directory specific requirements
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 10 Aug 2020 18:08:15 -0700] rev 45394
requirements: introduce a set of working directory specific requirements Some requirements like the SPARSE_REQUIREMENT is working directory specific and cannot be shared. We add a set which will contain all these requirements. This is not the best we can do, I think having a rich requirement class will be much better but that will be out of scope for this series. Differential Revision: https://phab.mercurial-scm.org/D8924
Sat, 08 Aug 2020 16:37:59 +0530 localrepo: move requirements constant to requirements module
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 08 Aug 2020 16:37:59 +0530] rev 45393
localrepo: move requirements constant to requirements module We now have a dedicated module for requirements constant, let's move the ones in localrepo there. Differential Revision: https://phab.mercurial-scm.org/D8918
Sat, 08 Aug 2020 16:24:12 +0530 requirements: introduce new requirements related module
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 08 Aug 2020 16:24:12 +0530] rev 45392
requirements: introduce new requirements related module It was not clear where all requirements should and related APIs should be, this patch introduces a requirements module which will have all exitsing requirements and related APIs. Differential Revision: https://phab.mercurial-scm.org/D8917
Sat, 08 Aug 2020 15:48:17 +0530 repository: introduce constant for treemanifest requirement and use it
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 08 Aug 2020 15:48:17 +0530] rev 45391
repository: introduce constant for treemanifest requirement and use it In future we will like to much cleaner logic around which requirement is for working copy and which can go in store. To start with that, we first need to de-clutter the requirement values spread around and replace them with constants. Differential Revision: https://phab.mercurial-scm.org/D8916
Tue, 21 Jul 2020 22:13:54 +0200 tests: make flag parsing test more future safe
Joerg Sonnenberger <joerg@bec.de> [Tue, 21 Jul 2020 22:13:54 +0200] rev 45390
tests: make flag parsing test more future safe The revlog format contains a number of feature flags, e.g. if general deltas are active. When testing that unknown flags are rejected, use bits that are not immediately following the currently used bits. Differential Revision: https://phab.mercurial-scm.org/D8782
Tue, 28 Jul 2020 09:58:28 -0700 rename: add support for --at-rev, which marks as copy and removes the source
Martin von Zweigbergk <martinvonz@google.com> [Tue, 28 Jul 2020 09:58:28 -0700] rev 45389
rename: add support for --at-rev, which marks as copy and removes the source I had previously only added support for `--at-rev` to `hg cp`, but not to `hg mv`. This patch adds that support. Just like for `hg cp`, it marks the destination as copied from the source, and doesn't care if the source file still exists (because it only supports the `-A` mode, aka "don't touch files" mode). It works whether or not the source file still exists. This matches the behavior of `hg mv -A` in the working copy. Differential Revision: https://phab.mercurial-scm.org/D8840
Fri, 24 Jul 2020 15:03:14 -0700 tests: make test-install.t work on debian systems
Kyle Lippincott <spectral@google.com> [Fri, 24 Jul 2020 15:03:14 -0700] rev 45388
tests: make test-install.t work on debian systems Debian systems, at least as of their version of python3.8 on my machine, have rewritten some logic in ensurepip to make it not use the wheels in pip._bundled, but instead to use wheels installed in /usr/share/python-wheels. It copies these wheels into the virtual environment when it's created, and installenv/bin/pip is able to see them and use them, so it thinks that 'wheel' is installed, and that it can build the mercurial wheel instead of just installing it. For some reason, when it subprocesses to run `python3 setup.py bdist_wheel`, it setup.py does *not* have the 'wheel' wheel available, and we get an error message. Differential Revision: https://phab.mercurial-scm.org/D8813
Fri, 24 Jul 2020 10:34:04 +0200 rhg: handle broken pipe error for stderr
Antoine Cezar <antoine.cezar@octobus.net> [Fri, 24 Jul 2020 10:34:04 +0200] rev 45387
rhg: handle broken pipe error for stderr Differential Revision: https://phab.mercurial-scm.org/D8871
Fri, 24 Jul 2020 17:24:10 +0200 rhg: extract function handle_stdout_error
Antoine Cezar <antoine.cezar@octobus.net> [Fri, 24 Jul 2020 17:24:10 +0200] rev 45386
rhg: extract function handle_stdout_error Avoid repeating the logic of handling stdout write errors. Differential Revision: https://phab.mercurial-scm.org/D8870
Fri, 17 Jul 2020 17:24:54 +0200 rhg: add a limited `rhg files` subcommand
Antoine Cezar <antoine.cezar@octobus.net> [Fri, 17 Jul 2020 17:24:54 +0200] rev 45385
rhg: add a limited `rhg files` subcommand Differential Revision: https://phab.mercurial-scm.org/D8869
Wed, 29 Jul 2020 10:21:17 +0200 rhg: add a `Files` `Command` to prepare the `rhg files` subcommand
Antoine Cezar <antoine.cezar@octobus.net> [Wed, 29 Jul 2020 10:21:17 +0200] rev 45384
rhg: add a `Files` `Command` to prepare the `rhg files` subcommand Differential Revision: https://phab.mercurial-scm.org/D8868
Wed, 29 Jul 2020 15:49:44 +0200 rhg: simplify `FindRootError` handling
Antoine Cezar <antoine.cezar@octobus.net> [Wed, 29 Jul 2020 15:49:44 +0200] rev 45383
rhg: simplify `FindRootError` handling Differential Revision: https://phab.mercurial-scm.org/D8867
Wed, 29 Jul 2020 10:26:17 +0200 rhg: add buffered stdout writing possibility
Antoine Cezar <antoine.cezar@octobus.net> [Wed, 29 Jul 2020 10:26:17 +0200] rev 45382
rhg: add buffered stdout writing possibility Improve batch stdout writing performance. At some point line buffered output should be introduced. Differential Revision: https://phab.mercurial-scm.org/D8866
Mon, 20 Jul 2020 18:14:52 +0200 rhg: ask the error message from `CommandError`
Antoine Cezar <antoine.cezar@octobus.net> [Mon, 20 Jul 2020 18:14:52 +0200] rev 45381
rhg: ask the error message from `CommandError` Avoid repeating the display of the same error messages in different commands. Differential Revision: https://phab.mercurial-scm.org/D8865
Tue, 21 Jul 2020 10:39:30 +0200 rhg: Do not return error when when we really mean ok in commands
Antoine Cezar <antoine.cezar@octobus.net> [Tue, 21 Jul 2020 10:39:30 +0200] rev 45380
rhg: Do not return error when when we really mean ok in commands Before when a command was successfull `Err(CommandErrorKind::Ok.into())` was returned which is an oxymoron. Using `Ok(())` when everything is ok seems more appropriate. Differential Revision: https://phab.mercurial-scm.org/D8864
Sat, 08 Aug 2020 12:52:39 -0700 hg-core: define a `ListTrackedFiles` `Operation`
Antoine Cezar <antoine.cezar@octobus.net> [Sat, 08 Aug 2020 12:52:39 -0700] rev 45379
hg-core: define a `ListTrackedFiles` `Operation` List files under Mercurial control in the working directory. Differential Revision: https://phab.mercurial-scm.org/D8863
Wed, 29 Jul 2020 10:08:09 +0200 hg-core: remove the `Operation` trait
Antoine Cezar <antoine.cezar@octobus.net> [Wed, 29 Jul 2020 10:08:09 +0200] rev 45378
hg-core: remove the `Operation` trait There is no way to currently define a trait which can both return references to `self` and to passed data, which is what we would need. Generic Associated Types may fix this and allow us to have a unified interface. See: rust #44265 Differential Revision: https://phab.mercurial-scm.org/D8862
Tue, 04 Aug 2020 10:59:43 +0200 hg-core: make parse_dirstate return references rather than update hashmaps
Antoine Cezar <antoine.cezar@octobus.net> [Tue, 04 Aug 2020 10:59:43 +0200] rev 45377
hg-core: make parse_dirstate return references rather than update hashmaps Returing a vec is faster than updating a hashmap when the hashmap is not needed like in `hg files` which just list tracked files. Returning references avoid copying data when not needed improving performence for large repositories. Differential Revision: https://phab.mercurial-scm.org/D8861
Fri, 07 Aug 2020 18:01:48 +0530 repository: introduce constant for internal phase repo requirement and use it
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 07 Aug 2020 18:01:48 +0530] rev 45376
repository: introduce constant for internal phase repo requirement and use it In future we will like to much cleaner logic around which requirement is for working copy and which can go in store. To start with that, we first need to de-clutter the requirement values spread around and replace them with constants. Differential Revision: https://phab.mercurial-scm.org/D8912
Sat, 08 Aug 2020 10:06:32 -0700 repository: introduce constant for sparse repo requirement and use it
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 08 Aug 2020 10:06:32 -0700] rev 45375
repository: introduce constant for sparse repo requirement and use it In future we will like to much cleaner logic around which requirement is for working copy and which can go in store. To start with that, we first need to de-clutter the requirement values spread around and replace them with constants. Differential Revision: https://phab.mercurial-scm.org/D8911
Fri, 07 Aug 2020 16:02:13 +0530 localrepo: refactor `.hg/requires` reading logic in separate function
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 07 Aug 2020 16:02:13 +0530] rev 45374
localrepo: refactor `.hg/requires` reading logic in separate function In an upcoming patch, we will be reusing this to read `.hg/store/requires`, so let's separate it in a different function before. Differential Revision: https://phab.mercurial-scm.org/D8910
(0) -30000 -10000 -3000 -1000 -300 -100 -50 -28 +28 +50 +100 +300 +1000 +3000 tip