Mon, 10 Aug 2020 15:47:21 +0530 mergestate: replace `addmergedother()` with generic `addcommitinfo()` (API)
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 10 Aug 2020 15:47:21 +0530] rev 45385
mergestate: replace `addmergedother()` with generic `addcommitinfo()` (API) Storing that a file is resolved for the other parent while merging is just one case of things we will like to store in the mergestate. There are more which we will like to store. This patch replaces `addmergedother()` with a much more generic `addcommitinfo()`. Doing this, we also blinding stores the same key value pair generated by the merge code instead of touching them. Differential Revision: https://phab.mercurial-scm.org/D8923
Mon, 10 Aug 2020 15:38:45 +0530 merge: introduce `addcommitinfo()` on mergeresult object
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 10 Aug 2020 15:38:45 +0530] rev 45384
merge: introduce `addcommitinfo()` on mergeresult object This makes code little bit nicer as we directly update information in the mergeresult object instead of building up a dict first and then setting it. Differential Revision: https://phab.mercurial-scm.org/D8922
Mon, 10 Aug 2020 15:34:27 +0530 merge: use collections.defaultdict() for mergeresult.commitinfo
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 10 Aug 2020 15:34:27 +0530] rev 45383
merge: use collections.defaultdict() for mergeresult.commitinfo We will be storing info from mergeresult.commitinfo to mergestate._stateextras in upcoming patches, let's make them use same structure so that we don't have to make much efforts in transferring info from one to other. Differential Revision: https://phab.mercurial-scm.org/D8921
Mon, 10 Aug 2020 15:29:02 +0530 mergestate: use _stateextras instead of merge records for commit related info
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 10 Aug 2020 15:29:02 +0530] rev 45382
mergestate: use _stateextras instead of merge records for commit related info There is a set of information related to a merge which is needed on commit. We want to store such information in the mergestate so that we can read it while committing. For this purpose, we are using merge records and introduced a merge entry state for that. However this won't scale and is not clean way to implement this. This patch reworks the existing logic related to this to use _stateextras and read from it. Right now the information stored is not very descriptive but it will be in next patch. Using _stateextras also makes MERGE_RECORD_MERGED_OTHER useless and only to be kept for BC. Differential Revision: https://phab.mercurial-scm.org/D8920
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 45381
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 45380
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 45379
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 45378
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 45377
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 45376
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
(0) -30000 -10000 -3000 -1000 -300 -100 -10 +10 +100 +300 +1000 +3000 tip