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 45372
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 45371
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 45370
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 45369
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 45368
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 45367
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 45366
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 45365
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 45364
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 45363
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 45362
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 45361
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 45360
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 45359
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 45358
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 45357
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 45356
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 45355
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 45354
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
Fri, 07 Aug 2020 15:52:52 +0530 localrepo: refactor logic to calculate sharedvfs in separate fn
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 07 Aug 2020 15:52:52 +0530] rev 45353
localrepo: refactor logic to calculate sharedvfs in separate fn We will be reusing this in an upcoming patch, so better to refactor it into a separate function. Also the underlying handling deserves a function of it's own. Differential Revision: https://phab.mercurial-scm.org/D8909
Sun, 02 Aug 2020 17:40:35 +0200 keepalive: Do not append _rbuf if _raw_readinto exists (issue6356) stable
Cédric Krier <ced@b2ck.com> [Sun, 02 Aug 2020 17:40:35 +0200] rev 45352
keepalive: Do not append _rbuf if _raw_readinto exists (issue6356) The readline method append to the chunks the content of the _rbuf then there is a loop that call _raw_read which on Python3 call readinto. But the readinto version in mercurial append again the _rbuf content. So this creates the duplicate content. This does not happen in Python2 because _raw_read does not call readinto. Differential Revision: https://phab.mercurial-scm.org/D8859
Sat, 08 Aug 2020 10:13:37 -0700 store: refactor space delimited list to proper data structure
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 08 Aug 2020 10:13:37 -0700] rev 45351
store: refactor space delimited list to proper data structure There is no good reason why are having a space delimited list and then using `.split()` to get the actual list. Let's convert this into a proper collection. Differential Revision: https://phab.mercurial-scm.org/D8908
Fri, 07 Aug 2020 21:59:43 -0700 makefile: stop setting unused HGEXTDIR variable during osx build
Martin von Zweigbergk <martinvonz@google.com> [Fri, 07 Aug 2020 21:59:43 -0700] rev 45350
makefile: stop setting unused HGEXTDIR variable during osx build The variable was added in a38ed42cd23c (osx: include chg by default, 2017-03-20), but I can't find any others references to the variable in that commit or in any other commits. Differential Revision: https://phab.mercurial-scm.org/D8915
Thu, 06 Aug 2020 13:51:43 +0530 merge: drop commitinfo argument to applyupdates (API)
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 06 Aug 2020 13:51:43 +0530] rev 45349
merge: drop commitinfo argument to applyupdates (API) We now pass the mergeresult object and hence there is no need to have a separate commitinfo argument as the required info is present in mergeresult object. Differential Revision: https://phab.mercurial-scm.org/D8904
Thu, 06 Aug 2020 13:27:38 +0530 merge: remove emptyactions() and use collections.defaultdict(list) instead
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 06 Aug 2020 13:27:38 +0530] rev 45348
merge: remove emptyactions() and use collections.defaultdict(list) instead emptyactions() used to return a dict which was populated and passed into applyupdates(). However, with recent changes, we no longer pass a plain dict, instead we pass the mergeresult object. There was only one usage of emptyactions and that too inside mergeresult object. That usage is replaced with collections.defaultdict(list) instead. Not sure why we were not using collections.defaultdict(list) from the beginning. Differential Revision: https://phab.mercurial-scm.org/D8903
Wed, 05 Aug 2020 16:52:51 +0530 merge: pass mergeresult obj in _forgetremoved() (API)
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 05 Aug 2020 16:52:51 +0530] rev 45347
merge: pass mergeresult obj in _forgetremoved() (API) Instead of returning a dict of actions and then updating it, let's pass the object directly and update it there. This makes `updateactions()` on mergeresult unused and this patch removes that. After this patch, we have couple of methods left on mergeresult class which still exposes the internal dict based action storage. Differential Revision: https://phab.mercurial-scm.org/D8889
Wed, 05 Aug 2020 16:00:25 +0530 mergeresult: introduce filemap() which yields filename based mapping
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 05 Aug 2020 16:00:25 +0530] rev 45346
mergeresult: introduce filemap() which yields filename based mapping We wanted to remove `actions` as this was leaking how we store things internally and was direct access to one of the member. This introduces filemap() which yields a map of `filename` -> `action, args, msg`. `mergeresult.actions` has been deleted as it's no longer required. Differential Revision: https://phab.mercurial-scm.org/D8888
Wed, 05 Aug 2020 15:41:23 +0530 mergeresult: add `files()` and use it
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 05 Aug 2020 15:41:23 +0530] rev 45345
mergeresult: add `files()` and use it `files()` will return a list of files on which an action needs to be performed. This is a step to stop exposing the underlying map to the user of this object. Differential Revision: https://phab.mercurial-scm.org/D8887
Wed, 05 Aug 2020 15:37:26 +0530 mergeresult: introduce getfile() and use it where required
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 05 Aug 2020 15:37:26 +0530] rev 45344
mergeresult: introduce getfile() and use it where required We want to hide the underlying dictionary from the users and provide API for valid and sane use cases. Differential Revision: https://phab.mercurial-scm.org/D8886
Wed, 05 Aug 2020 14:03:59 +0530 merge: use ACTION_* constants instead of values in _filternarrowactions()
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 05 Aug 2020 14:03:59 +0530] rev 45343
merge: use ACTION_* constants instead of values in _filternarrowactions() It makes easier to check what noconflicttypes are and which are not included. I hope we can have a state where we always use ACTION_* constants instead of these values which are very hard to understand. Differential Revision: https://phab.mercurial-scm.org/D8885
Wed, 05 Aug 2020 13:50:49 +0530 merge: rework iteration over mergeresult object in checkpathconflicts()
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 05 Aug 2020 13:50:49 +0530] rev 45342
merge: rework iteration over mergeresult object in checkpathconflicts() Instead of following pattern: ``` for f, (m, args, msg) in mresult.actions.items(): if m == mergestatemod.ACTION_*: ... elif m == mergestatemod.ACTION_*: ... .... ``` We do: ``` for (f, args, msg) in mresult.getaction((mergestatemod.ACTION_*,)): ... for (f, args, msg) in mresult.getaction((mergestatemod.ACTION_*,)): ... .... ``` This makes code bit easier to understand and prevent iterating over actions which we don't need. Differential Revision: https://phab.mercurial-scm.org/D8884
Wed, 05 Aug 2020 13:21:06 +0530 applyupdates: simplfy calculation of number of updated files
Pulkit Goyal <7895pulkit@gmail.com> [Wed, 05 Aug 2020 13:21:06 +0530] rev 45341
applyupdates: simplfy calculation of number of updated files Instead of increasing the `updated` variable each time in a loop, let's use the mergeresult object API to calculate the updated value in one call. Differential Revision: https://phab.mercurial-scm.org/D8883
Mon, 03 Aug 2020 18:08:37 +0530 mergeresult: yield from getactions() instead of buidling a list and returning
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 18:08:37 +0530] rev 45340
mergeresult: yield from getactions() instead of buidling a list and returning Only 7 out of 29 callers change the underlying dict while iterating. So it's better to yield and wrap the 7 callers with `list()`. Differential Revision: https://phab.mercurial-scm.org/D8882
Mon, 03 Aug 2020 18:33:00 +0530 sparse: replace merge action values with mergestate.ACTION_* constants
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 18:33:00 +0530] rev 45339
sparse: replace merge action values with mergestate.ACTION_* constants Having bytestrings like `b'r'` makes it hard to understand for people who don't know the code much or looking at it for the first time. Differential Revision: https://phab.mercurial-scm.org/D8881
Mon, 03 Aug 2020 17:58:18 +0530 mergeresult: implement a len() function and use it
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 17:58:18 +0530] rev 45338
mergeresult: implement a len() function and use it In next patch we will start yielding from `getactions()` instead of building and returning a list. Hence we can no longer rely on that for getting us a length. Differential Revision: https://phab.mercurial-scm.org/D8880
Mon, 03 Aug 2020 17:32:30 +0530 merge: replace use of actions dict with mergeresult object
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 17:32:30 +0530] rev 45337
merge: replace use of actions dict with mergeresult object There are still some places which can be improved by having a dedicated API, this patch for now make all users of actions dict go through the mergeresult object API. Differential Revision: https://phab.mercurial-scm.org/D8879
Mon, 03 Aug 2020 14:54:45 +0530 mergeresult: add sort argument to getactions() method
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 14:54:45 +0530] rev 45336
mergeresult: add sort argument to getactions() method This will be used in next patch. Differential Revision: https://phab.mercurial-scm.org/D8878
Mon, 03 Aug 2020 14:19:06 +0530 merge: pass mergeresult obj in merge._prefetchfiles()
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 14:19:06 +0530] rev 45335
merge: pass mergeresult obj in merge._prefetchfiles() Differential Revision: https://phab.mercurial-scm.org/D8877
Mon, 03 Aug 2020 14:12:13 +0530 merge: pass mergeresult obj instead of actions in applyupdates() (API)
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 14:12:13 +0530] rev 45334
merge: pass mergeresult obj instead of actions in applyupdates() (API) This is similar to past 20 patches or so where we are replacing use of a bare actions dict with a dedicated mergeresult object. The goal is to have a dedicated powerful object instead of a dict while making the code more easier to understand. In past few patches, we have already simplified the code at some places using the newly introduced object. This patch does not updates applyupdates() to use the mergeresult object directly. That will be done in next patch to make things easier to review. Differential Revision: https://phab.mercurial-scm.org/D8876
Mon, 03 Aug 2020 13:30:14 +0530 merge: pass mergeresult obj instead of actions in _checkcollision() (API)
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 13:30:14 +0530] rev 45333
merge: pass mergeresult obj instead of actions in _checkcollision() (API) The goal is to not use the actions dict and replace it with a rich mergeresult object. Differential Revision: https://phab.mercurial-scm.org/D8875
Tue, 28 Jul 2020 20:21:06 +0200 commitctx: directly update the touched and added set of files
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 28 Jul 2020 20:21:06 +0200] rev 45332
commitctx: directly update the touched and added set of files Instead of going through intermediate variable, we can simply use the ChangingFiles object. The object will take care of the consistency.
Tue, 28 Jul 2020 20:19:09 +0200 commitctx: directly updated the set of removed files
Pierre-Yves David <pierre-yves.david@octobus.net> [Tue, 28 Jul 2020 20:19:09 +0200] rev 45331
commitctx: directly updated the set of removed files The change is non-trivial so I made it in its own changeset.
Wed, 29 Jul 2020 16:48:31 +0200 commitctx: create the `ChangingFiles` object sooner
Pierre-Yves David <pierre-yves.david@octobus.net> [Wed, 29 Jul 2020 16:48:31 +0200] rev 45330
commitctx: create the `ChangingFiles` object sooner Let us change the `_commit_manifest` call before other changes.
Sat, 25 Jul 2020 16:34:02 +0200 commitctx: move ChangingFiles creation directly inside `_process_files`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 25 Jul 2020 16:34:02 +0200] rev 45329
commitctx: move ChangingFiles creation directly inside `_process_files` As announced, we move it there. We focus on the signature change first, we will update the code afterward.
Sat, 25 Jul 2020 16:13:32 +0200 commitctx: create the ChangingFiles object directly in the various case
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 25 Jul 2020 16:13:32 +0200] rev 45328
commitctx: create the ChangingFiles object directly in the various case No need to compute all data then create the object, we can create it early and directly store data in it. We start simple by moving create higher in the function, but the end goal is to eventually move the creation inside the `_process_files` function to take advantage of the object there.
Sat, 25 Jul 2020 16:13:17 +0200 commitctx: no longer make the storage and added/removed file optional
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 25 Jul 2020 16:13:17 +0200] rev 45327
commitctx: no longer make the storage and added/removed file optional The code using this variable is always using other, stricter, condition before using these value. So it is safe to always carry them along.
Sat, 25 Jul 2020 16:07:38 +0200 commitctx: directly gather p1 and p2 copies in `files`
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 25 Jul 2020 16:07:38 +0200] rev 45326
commitctx: directly gather p1 and p2 copies in `files` The only thing we do with the p1copies and p2copies is to pass them around, we we can gather them later and directly stored them in the `ChangingFiles` object.
Sat, 25 Jul 2020 16:02:26 +0200 commitctx: extract sidedata encoding inside its own function
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 25 Jul 2020 16:02:26 +0200] rev 45325
commitctx: extract sidedata encoding inside its own function This part of the code is quite independent from the rest. Thank to the new ChangingFiles object, moving with the rest of the sidedata code (in metadata.py) is simple. The changelog.add method is simply passing the `files` object to the new function. It will be easy to increase/change the data we gather and encode without impacting the changelog method.
Sat, 25 Jul 2020 15:55:09 +0200 commitctx: directly pass a ChangingFiles object to changelog.add
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 25 Jul 2020 15:55:09 +0200] rev 45324
commitctx: directly pass a ChangingFiles object to changelog.add We pass the rich object to the changelog and it read the field it needs.
Sat, 25 Jul 2020 15:49:12 +0200 commitctx: return a richer object from _prepare_files
Pierre-Yves David <pierre-yves.david@octobus.net> [Sat, 25 Jul 2020 15:49:12 +0200] rev 45323
commitctx: return a richer object from _prepare_files Instead of returning a lot of different list, we introduce a rich object that hold all the file related information. The unique object help with data consistency and simply functions arguments and return. In the rest of this series we will increase usage of this object to simplify more code.
Thu, 06 Aug 2020 10:53:00 -0700 templater: teach template loader to use open_template() function
Martin von Zweigbergk <martinvonz@google.com> [Thu, 06 Aug 2020 10:53:00 -0700] rev 45322
templater: teach template loader to use open_template() function The template loader can apparently load templates from relative paths, so I needed to add that support to `open_template()`. This takes the number of failing tests with PyOxidizer from 54 to 34. Differential Revision: https://phab.mercurial-scm.org/D8907
Thu, 06 Aug 2020 10:52:52 -0700 templater: restructure open_template() a little to prepare for relative paths
Martin von Zweigbergk <martinvonz@google.com> [Thu, 06 Aug 2020 10:52:52 -0700] rev 45321
templater: restructure open_template() a little to prepare for relative paths I found that it was easier to add support for relative paths after this restructuring. It also made it easier to explain each case with a code comment (which I did). Differential Revision: https://phab.mercurial-scm.org/D8906
Thu, 06 Aug 2020 09:50:10 -0700 templater: add exception-raising version of open_template()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 06 Aug 2020 09:50:10 -0700] rev 45320
templater: add exception-raising version of open_template() I'm about to add another caller of `open_template()` (in the template loader). That caller will want to get exceptions instead of `(None, None)` if the template doesn't exist. This patch therefore changes `open_template()` to raise exceptions and adds a new `try_open_template()` that returns the `(None, None)` value. Differential Revision: https://phab.mercurial-scm.org/D8905
Wed, 05 Aug 2020 22:13:51 -0700 templater: replace Py3-only exception types by super-types available in Py2
Martin von Zweigbergk <martinvonz@google.com> [Wed, 05 Aug 2020 22:13:51 -0700] rev 45319
templater: replace Py3-only exception types by super-types available in Py2 As noted by @indygreg, `test-check-pyflakes.t` started failing on Py2 after my recent D8894, because that introduced catching of the Py3-only types `ModuleNotFoundError` and `FileNotFoundError`. Let's switch to less precise types that are also available in Py2. Differential Revision: https://phab.mercurial-scm.org/D8902
Wed, 05 Aug 2020 14:19:42 -0700 hgweb: enable reading styles from resources in frozen binaries
Martin von Zweigbergk <martinvonz@google.com> [Wed, 05 Aug 2020 14:19:42 -0700] rev 45318
hgweb: enable reading styles from resources in frozen binaries All we need to do to read styles from resources is to pass the file-like object we get from `open_template()` on to `frommapfile()`. This takes the number of failing tests with PyOxidizer from 62 to 54. Differential Revision: https://phab.mercurial-scm.org/D8901
Wed, 05 Aug 2020 14:03:45 -0700 hgweb: rely on open_template()'s fallback to using templatedir()
Martin von Zweigbergk <martinvonz@google.com> [Wed, 05 Aug 2020 14:03:45 -0700] rev 45317
hgweb: rely on open_template()'s fallback to using templatedir() Differential Revision: https://phab.mercurial-scm.org/D8900
Wed, 05 Aug 2020 14:03:14 -0700 hgweb: open mapfile using templater.open_template()
Martin von Zweigbergk <martinvonz@google.com> [Wed, 05 Aug 2020 14:03:14 -0700] rev 45316
hgweb: open mapfile using templater.open_template() This will help us read templates from resources in frozen binaries. Differential Revision: https://phab.mercurial-scm.org/D8899
Wed, 05 Aug 2020 13:58:30 -0700 hgweb: simplify a constant-length list by converting to literal tuple
Martin von Zweigbergk <martinvonz@google.com> [Wed, 05 Aug 2020 13:58:30 -0700] rev 45315
hgweb: simplify a constant-length list by converting to literal tuple The call to `.append()` has been unnecessary since d3dbdca92458 (hgweb: don't choke when an inexistent style is requested (issue1901), 2009-11-12). Differential Revision: https://phab.mercurial-scm.org/D8898
Wed, 05 Aug 2020 13:33:07 -0700 hgweb: remove some accesses to private member uimod._unset
Martin von Zweigbergk <martinvonz@google.com> [Wed, 05 Aug 2020 13:33:07 -0700] rev 45314
hgweb: remove some accesses to private member uimod._unset Differential Revision: https://phab.mercurial-scm.org/D8897
Thu, 30 Jul 2020 21:36:29 -0700 templater: try to read %include in mapfiles from resources
Martin von Zweigbergk <martinvonz@google.com> [Thu, 30 Jul 2020 21:36:29 -0700] rev 45313
templater: try to read %include in mapfiles from resources The "show" style is an example of a style that uses an "%include" statement in its definition. This patch makes `hg log --style show` work. This takes the number of failing tests with PyOxidizer from 72 to 62. Differential Revision: https://phab.mercurial-scm.org/D8896
Thu, 30 Jul 2020 15:29:06 -0700 templater: unroll loop over mapfile directories
Martin von Zweigbergk <martinvonz@google.com> [Thu, 30 Jul 2020 15:29:06 -0700] rev 45312
templater: unroll loop over mapfile directories I'll rewrite the handling of the `templatedir()` case in the next patch, so the two cases will be more different and the loop won't make as much sense. Differential Revision: https://phab.mercurial-scm.org/D8895
Tue, 04 Aug 2020 10:51:25 -0700 templater: make open_template() read from resources if in frozen binary
Martin von Zweigbergk <martinvonz@google.com> [Tue, 04 Aug 2020 10:51:25 -0700] rev 45311
templater: make open_template() read from resources if in frozen binary This takes the number of failing tests with PyOxidizer from 87 to 72. Differential Revision: https://phab.mercurial-scm.org/D8894
Tue, 04 Aug 2020 13:22:00 -0700 templater: pass opened file-like object to templatespec
Martin von Zweigbergk <martinvonz@google.com> [Tue, 04 Aug 2020 13:22:00 -0700] rev 45310
templater: pass opened file-like object to templatespec I think I said earlier that I planned to create a special templatespec variant for built-in templates. That was true (I planned that), but I ended up (in this patch) just adding a file-like object to the `mapfile_templatespec()` variant instead. Differential Revision: https://phab.mercurial-scm.org/D8893
Tue, 04 Aug 2020 13:21:29 -0700 templater: replace templatepath() with function that also opens the file
Martin von Zweigbergk <martinvonz@google.com> [Tue, 04 Aug 2020 13:21:29 -0700] rev 45309
templater: replace templatepath() with function that also opens the file For frozen binaries, such as those created by PyOxidizer, I plan to make it so the templatespec can keep an opened file/resource to read from instead of needing a file path. Having `templatepath()` return an opened file should help with that. At this point, it's just a wasteful extra opening of mapfiles that we'll open again later. I'll update the read-side next so it reads from the file-like object without opening the file again. Differential Revision: https://phab.mercurial-scm.org/D8892
Thu, 30 Jul 2020 13:44:06 -0700 templater: start passing resource to read from into _readmapfile()
Martin von Zweigbergk <martinvonz@google.com> [Thu, 30 Jul 2020 13:44:06 -0700] rev 45308
templater: start passing resource to read from into _readmapfile() This patch makes it so we pass in a file-like resource to read from instead of having `_readmapfile()` open the file. This is one more step towards making `_readmapfile()` able to read resources opened by from `importlib.resources`. We still need to pass in the mapfile path because it's used for loading dependent mapfiles from `%include` and `__base__`, and it's also used for giving the user better error messages. Besides that, one can safely call `_readmapfile()` with any file-like resource after this patch. Differential Revision: https://phab.mercurial-scm.org/D8891
Tue, 04 Aug 2020 09:13:10 -0700 templater: move stylemap() to hgweb_mod, since that's its only user
Martin von Zweigbergk <martinvonz@google.com> [Tue, 04 Aug 2020 09:13:10 -0700] rev 45307
templater: move stylemap() to hgweb_mod, since that's its only user `stylemap()` even has an error message that mentions "hgweb templates", so it seems that it's meant specifically for hgweb. Differential Revision: https://phab.mercurial-scm.org/D8890
Mon, 03 Aug 2020 22:15:45 -0700 hgweb: simplify staticfile() now that we always pass it a single directory
Martin von Zweigbergk <martinvonz@google.com> [Mon, 03 Aug 2020 22:15:45 -0700] rev 45306
hgweb: simplify staticfile() now that we always pass it a single directory I didn't realize this further simplifications enabled by D8786 until now. Differential Revision: https://phab.mercurial-scm.org/D8874
Fri, 31 Jul 2020 10:05:07 -0700 packaging: include templates with their package as key in package_data
Martin von Zweigbergk <martinvonz@google.com> [Fri, 31 Jul 2020 10:05:07 -0700] rev 45305
packaging: include templates with their package as key in package_data This is similar to an earlier patch in this series. It seems more correct to use `mercurial.templates.coal` etc as keys in the `package_data` dict now that those modules are packages. Differential Revision: https://phab.mercurial-scm.org/D8858
Fri, 31 Jul 2020 09:49:52 -0700 packaging: mark mercurial.templates and subdirs as packages
Martin von Zweigbergk <martinvonz@google.com> [Fri, 31 Jul 2020 09:49:52 -0700] rev 45304
packaging: mark mercurial.templates and subdirs as packages We need these packages to be installed so PyOxidizer picks them up. Differential Revision: https://phab.mercurial-scm.org/D8855
Thu, 12 Dec 2019 12:41:01 -0800 templates: add __init__.py files to templates/ dirs
Martin von Zweigbergk <martinvonz@google.com> [Thu, 12 Dec 2019 12:41:01 -0800] rev 45303
templates: add __init__.py files to templates/ dirs This is necessary for them to be loaded with `importlib.resources`, which we want to do for PyOxidizer and similar. `importlib.resources` cannot read resources from submodules (`resources.open_binary('mercurial.templates', 'coal/map')` is not valid), so we need one `__init__.py` per directory. Differential Revision: https://phab.mercurial-scm.org/D8854
Wed, 05 Aug 2020 13:36:50 -0400 merge with stable
Augie Fackler <augie@google.com> [Wed, 05 Aug 2020 13:36:50 -0400] rev 45302
merge with stable
Tue, 21 Jul 2020 18:21:27 +0530 localrepo: abort creating a shared repo if the source does not have store
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 21 Jul 2020 18:21:27 +0530] rev 45301
localrepo: abort creating a shared repo if the source does not have store We cannot create a shared repository without a store IIUC. Let's abort in such cases. Differential Revision: https://phab.mercurial-scm.org/D8772
Tue, 21 Jul 2020 13:58:58 +0530 localrepo: only use 'bookmarksinstore' requirement if we have 'store'
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 21 Jul 2020 13:58:58 +0530] rev 45300
localrepo: only use 'bookmarksinstore' requirement if we have 'store' This adds check that whether we have the 'store' requirement or not. If we don't have that, we skip adding the 'bookmarksinstore' requirement and warn user about it. Differential Revision: https://phab.mercurial-scm.org/D8771
Sat, 25 Jul 2020 01:42:41 +0530 mergeresult: make actionmapping a dict of dict instead of dict of lists
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 25 Jul 2020 01:42:41 +0530] rev 45299
mergeresult: make actionmapping a dict of dict instead of dict of lists This makes deleting a specific filename entry faster and easier. Differential Revision: https://phab.mercurial-scm.org/D8837
Sat, 25 Jul 2020 14:44:29 +0530 largefiles: introduce a constant for 'lfmr' action
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 25 Jul 2020 14:44:29 +0530] rev 45298
largefiles: introduce a constant for 'lfmr' action It's better to use a dedicated constant instead of a string which makes pretty less sense. Differential Revision: https://phab.mercurial-scm.org/D8836
Sat, 25 Jul 2020 14:41:20 +0530 largefiles: override merge.emptyactions() to include `lfmr`
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 25 Jul 2020 14:41:20 +0530] rev 45297
largefiles: override merge.emptyactions() to include `lfmr` I found it weird that we were not already doing this. I encountered this while using `emptyactions()` in mergeresult() class. Differential Revision: https://phab.mercurial-scm.org/D8835
Sat, 25 Jul 2020 01:17:35 +0530 merge: unify logic of couple of if-else's in manifestmerge()
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 25 Jul 2020 01:17:35 +0530] rev 45296
merge: unify logic of couple of if-else's in manifestmerge() Right now manifestmerge() contains very nested if-else conditions and it's not easy to understand what is happening. I was looking for easy unifications and found these two. Differential Revision: https://phab.mercurial-scm.org/D8834
Fri, 24 Jul 2020 23:49:08 +0530 sparse: add comment for an if condition which I tried to refactor
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 23:49:08 +0530] rev 45295
sparse: add comment for an if condition which I tried to refactor I tried to refactor this if condition and make it part of the if-else above but tests failed. I decided to add a comment about the check we are doing and why it's a separate if. Differential Revision: https://phab.mercurial-scm.org/D8833
Fri, 24 Jul 2020 23:40:07 +0530 mergeactions: use action constants instead of string values
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 23:40:07 +0530] rev 45294
mergeactions: use action constants instead of string values Having constants inplace of strings like 'c', 'cm' etc. makes it easier to understand the code. Differential Revision: https://phab.mercurial-scm.org/D8832
Sun, 02 Aug 2020 10:24:28 -0700 merge: use the new action based mapping introduced in mergeresult obj
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 02 Aug 2020 10:24:28 -0700] rev 45293
merge: use the new action based mapping introduced in mergeresult obj Before this patch, we have good number of instances of following types: ``` for f, (m, args, msg) in mresult.actions: if m == ACTION_X: do_something ``` We iterate over the whole list and then filter for a certain action. Previous patch introduced a action based mapping in mergeresult object. The above code now looks like: ``` for f, args, msg in mresult.getactions([ACTION_X, ...]): do_something ``` Differential Revision: https://phab.mercurial-scm.org/D8831
Fri, 24 Jul 2020 19:48:38 +0530 mergeresult: introduce action -> (filename, data, msg) mapping and related API
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 19:48:38 +0530] rev 45292
mergeresult: introduce action -> (filename, data, msg) mapping and related API Good number of places in code, we iterate over the actions dict which has filename as keys and filter based on the action. This patch introduced another mapping which has action as key. This will help in refactoring the code much more in upcoming patch. Differential Revision: https://phab.mercurial-scm.org/D8830
Sun, 02 Aug 2020 10:15:55 -0700 mergeresult: rename _actions to _filemapping
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 02 Aug 2020 10:15:55 -0700] rev 45291
mergeresult: rename _actions to _filemapping This is done because we will be introducing another dict which introduces the same information but with action name as key. Differential Revision: https://phab.mercurial-scm.org/D8829
Fri, 24 Jul 2020 19:19:47 +0530 sparse: pass mergeresult obj in sparse.filterupdatesactions() (API)
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 19:19:47 +0530] rev 45290
sparse: pass mergeresult obj in sparse.filterupdatesactions() (API) Not able to see much which can be improved in this function by passing in mergeresult object but for API consistency and no function directly touching actions dict, it sounds like a good idea. Differential Revision: https://phab.mercurial-scm.org/D8828
Fri, 24 Jul 2020 19:13:20 +0530 merge: filter actions before calling _resolvetrivial()
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 19:13:20 +0530] rev 45289
merge: filter actions before calling _resolvetrivial() In d49e490a9e85252886fd43258803bcad4fc88edb I made _resolvetrivial() to be called after upadting the sparse checkout. Looking at the code now, it seems to that me there is no need to even run _resolvetrivial() on actions which are filtered away. So let's update the actions before passing them into _resolvetrivial(). Differential Revision: https://phab.mercurial-scm.org/D8827
Fri, 24 Jul 2020 18:16:29 +0530 merge: introduce mergeresult.updateactions() and use it
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 18:16:29 +0530] rev 45288
merge: introduce mergeresult.updateactions() and use it We don't want direct editing and access of mergeresult._actions because soon we will like to maintain data in other structures also. Differential Revision: https://phab.mercurial-scm.org/D8826
Fri, 24 Jul 2020 17:57:23 +0530 merge: pass mergeresult instead of actions in _checkunknownfiles() (API)
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 17:57:23 +0530] rev 45287
merge: pass mergeresult instead of actions in _checkunknownfiles() (API) Differential Revision: https://phab.mercurial-scm.org/D8825
Fri, 24 Jul 2020 17:52:33 +0530 merge: pass mergeresult obj instead of actions dict in _resolvetrivial()
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 17:52:33 +0530] rev 45286
merge: pass mergeresult obj instead of actions dict in _resolvetrivial() Differential Revision: https://phab.mercurial-scm.org/D8824
Fri, 24 Jul 2020 17:49:13 +0530 merge: pass mergeresult obj instead of actions in _filternarrowactions()
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 17:49:13 +0530] rev 45285
merge: pass mergeresult obj instead of actions in _filternarrowactions() We want to use rich mergeresult object and it's APIs instead of handling a dictionary. Differential Revision: https://phab.mercurial-scm.org/D8823
Fri, 24 Jul 2020 17:31:26 +0530 merge: pass mergeresult in checkpassconflicts() instead of actions (API)
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 17:31:26 +0530] rev 45284
merge: pass mergeresult in checkpassconflicts() instead of actions (API) This is a part of series which aims to use mergeresult obj instead of an action dictionary. Differential Revision: https://phab.mercurial-scm.org/D8822
Fri, 24 Jul 2020 16:23:55 +0530 merge: add removefile() to mergeresult object
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 16:23:55 +0530] rev 45283
merge: add removefile() to mergeresult object There are cases where some further calculation makes the file not needing to be merged anymore and hence needs to be dropped in mergeresult object. This adds a function for that. Differential Revision: https://phab.mercurial-scm.org/D8821
Fri, 24 Jul 2020 16:18:39 +0530 merge: introduce mergeresult.addfile() and use it
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 16:18:39 +0530] rev 45282
merge: introduce mergeresult.addfile() and use it We want to use mergeresult object at more and more places instead of this actions dict to simplify code and further add new APIs to mergeresult object. This patch introduces `addfile()` which adds a new file to the internal actions dict for now. Differential Revision: https://phab.mercurial-scm.org/D8820
Fri, 24 Jul 2020 15:56:11 +0530 merge: make mergeresult constructor initialize empty object
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 15:56:11 +0530] rev 45281
merge: make mergeresult constructor initialize empty object In future patches, we will be going to update mergeresult object instead of building an actions dict and then setting it in the object. Differential Revision: https://phab.mercurial-scm.org/D8819
Fri, 24 Jul 2020 15:15:20 +0530 merge: improve documentation of fbid dict used for merge bid
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 15:15:20 +0530] rev 45280
merge: improve documentation of fbid dict used for merge bid I improved the comments explaning what the dict contains meanwhile organizing the comment structure which prevents some confusion. Due to formatting issues, the empty dict was wrapped in `()` which might decieve in thinking that it's a tuple of dict until you decide to find a comma. Differential Revision: https://phab.mercurial-scm.org/D8818
Fri, 24 Jul 2020 14:45:00 +0530 merge: move conversion of file-key dict to action-key dict in mergeresult
Pulkit Goyal <7895pulkit@gmail.com> [Fri, 24 Jul 2020 14:45:00 +0530] rev 45279
merge: move conversion of file-key dict to action-key dict in mergeresult Initially the actions dict which we get has file has keys, but later we want a dict which has actions as keys. This patch moves code computing that to mergeresult class as that's where it should be anyway. Differential Revision: https://phab.mercurial-scm.org/D8817
Sun, 02 Aug 2020 10:12:21 -0700 merge: introduce hasconflicts() on mergeresult object
Pulkit Goyal <7895pulkit@gmail.com> [Sun, 02 Aug 2020 10:12:21 -0700] rev 45278
merge: introduce hasconflicts() on mergeresult object This and upcoming patches will improve the mergeresult object making it more powerful and provide clean APIs for various things. Doing this will clean up the core merge code which is present in `update()` a bit. Differential Revision: https://phab.mercurial-scm.org/D8816
Tue, 14 Jul 2020 16:40:28 +0530 merge: remove no longer required ACTION_GET_OTHER_AND_STORE
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 14 Jul 2020 16:40:28 +0530] rev 45277
merge: remove no longer required ACTION_GET_OTHER_AND_STORE In 1b8fd4af33189c84feadb47c74d659ec31cde3b9 I (ab)used merge actions to pass info from manifestmerge() to applyupdates() and store info in mergestate. In previous patches, we introduced a separate return value from manifestmerge() and calculateupdates() and an argument to applyupdates() which achieved the same thing. Let's remove this no longer required messy code. Differential Revision: https://phab.mercurial-scm.org/D8744
Tue, 14 Jul 2020 16:31:52 +0530 merge: pass commitinfo to applyupdates() and get it stored in mergestate
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 14 Jul 2020 16:31:52 +0530] rev 45276
merge: pass commitinfo to applyupdates() and get it stored in mergestate This patch passes the commitinfo calulcated in manifestmerge() to applyupdates() so that it can be read there and stored in mergestate. On commit, we can read mergestate for such information and act accordingly. This patch also makes ACTION_GET_OTHER_AND_STORE not required anymore. Next patch will remove the messy code surrounding it. Differential Revision: https://phab.mercurial-scm.org/D8743
Tue, 14 Jul 2020 16:21:08 +0530 merge: introduce 'commitinfo' in mergeresult
Pulkit Goyal <7895pulkit@gmail.com> [Tue, 14 Jul 2020 16:21:08 +0530] rev 45275
merge: introduce 'commitinfo' in mergeresult commitinfo will be used to pass information which is required on commit phase from the merge phase. One common example is, merge chooses filenode from second parent and we need to tell commit to choose that. Right now this one and related cases are not very neatly implement and there is no clear line on how to pass on such information. Upcoming patches will try to work on in this area and make things easier. Differential Revision: https://phab.mercurial-scm.org/D8742
Thu, 23 Jul 2020 18:03:14 +0530 merge: return a mergeresult obj from manifestmerge(), calculateupdates() (API)
Pulkit Goyal <7895pulkit@gmail.com> [Thu, 23 Jul 2020 18:03:14 +0530] rev 45274
merge: return a mergeresult obj from manifestmerge(), calculateupdates() (API) Earlier, manifestmerge() and calculateupdates() returns a tuple of three things. I wanted to add one more thing to return value. Introducing a special class which represents results of a merge will help understand better and also ease adding new return values. Differential Revision: https://phab.mercurial-scm.org/D8799
Mon, 03 Aug 2020 23:13:58 +0530 Added signature for changeset 7fc3c5fbc65f stable
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 23:13:58 +0530] rev 45273
Added signature for changeset 7fc3c5fbc65f
Mon, 03 Aug 2020 23:13:52 +0530 Added tag 5.5 for changeset 7fc3c5fbc65f stable
Pulkit Goyal <7895pulkit@gmail.com> [Mon, 03 Aug 2020 23:13:52 +0530] rev 45272
Added tag 5.5 for changeset 7fc3c5fbc65f
Sat, 01 Aug 2020 18:39:28 +0530 mergestate: fix BC breakage introduced because of removal of a merge record stable 5.5
Pulkit Goyal <7895pulkit@gmail.com> [Sat, 01 Aug 2020 18:39:28 +0530] rev 45271
mergestate: fix BC breakage introduced because of removal of a merge record In fcd0cff3400a I removed the usage of RECORD_RESOLVED_OTHER. However I also removed the reading support, hence if there is any user who runs into merge conflict with older version of hg, upgrades hg and then tries to read mergestate, they will end up with an MergeRecordUnsupportedError.
Thu, 30 Jul 2020 22:49:51 -0700 packaging: delete unnecessary updating of `dirs` list
Martin von Zweigbergk <martinvonz@google.com> [Thu, 30 Jul 2020 22:49:51 -0700] rev 45270
packaging: delete unnecessary updating of `dirs` list The `dirs` list is not used and it seems it also wasn't used when this code was added in 395b0e132836 (Don't copy hidden files/directories during `setup.py install`, 2009-07-14). Differential Revision: https://phab.mercurial-scm.org/D8857
Sun, 02 Aug 2020 10:08:18 -0700 packaging: make "mercurial.defaultrc" a key in package_data
Martin von Zweigbergk <martinvonz@google.com> [Sun, 02 Aug 2020 10:08:18 -0700] rev 45269
packaging: make "mercurial.defaultrc" a key in package_data Before this patch, we had a `mercurial` key with a `defaultrc/*.rc` value. It seems more correct to have a `mercurial.defaultrc` key with a `*.rc` value since `mercurial.defaultrc` it became a pacakge in 1390bb81163e (help: get helptext/ data from `resources` module if available, 2019-12-12). Differential Revision: https://phab.mercurial-scm.org/D8856
Thu, 30 Jul 2020 12:22:41 -0700 templatespec: use new factory functions in hooklib
Martin von Zweigbergk <martinvonz@google.com> [Thu, 30 Jul 2020 12:22:41 -0700] rev 45268
templatespec: use new factory functions in hooklib Differential Revision: https://phab.mercurial-scm.org/D8853
Mon, 20 Jul 2020 22:43:33 -0700 templatespec: use new factory functions in logcmdutil
Martin von Zweigbergk <martinvonz@google.com> [Mon, 20 Jul 2020 22:43:33 -0700] rev 45267
templatespec: use new factory functions in logcmdutil Differential Revision: https://phab.mercurial-scm.org/D8848
Mon, 20 Jul 2020 21:33:28 -0700 templatespec: move check for non-unicode to lower-level function
Martin von Zweigbergk <martinvonz@google.com> [Mon, 20 Jul 2020 21:33:28 -0700] rev 45266
templatespec: move check for non-unicode to lower-level function Now that we have the factory functions, it makes sense to have the check there. Differential Revision: https://phab.mercurial-scm.org/D8847
Mon, 20 Jul 2020 21:32:10 -0700 templatespec: logcmdutil.templatespec() gets either template or mapfile
Martin von Zweigbergk <martinvonz@google.com> [Mon, 20 Jul 2020 21:32:10 -0700] rev 45265
templatespec: logcmdutil.templatespec() gets either template or mapfile The callers of the function already never pass (non-`None`) values for both, so let's check that and call the new factory functions. Differential Revision: https://phab.mercurial-scm.org/D8846
Thu, 16 Jul 2020 13:33:46 -0700 templatespec: create a factory function for each type there is
Martin von Zweigbergk <martinvonz@google.com> [Thu, 16 Jul 2020 13:33:46 -0700] rev 45264
templatespec: create a factory function for each type there is Most of the arguments to the `templatespec` constructor are mutually exclusive, so each combination creates a different type of templatespec. Let's clarify that by creating factory functions. I've left the callers in `logcmdutil` unchanged for now because they are more complex and `logcmdutil.templatespec()` is slightly higher level in that it is specific to changesets. My larger goal is to add support frozen binaries (specifically PyOxidizer) by adding a specific type of `templatespec` for built-in templates. That will get its own factory function. Differential Revision: https://phab.mercurial-scm.org/D8845
Wed, 29 Jul 2020 10:42:09 -0700 templater: stop accepting a single style to stylemap()
Martin von Zweigbergk <martinvonz@google.com> [Wed, 29 Jul 2020 10:42:09 -0700] rev 45263
templater: stop accepting a single style to stylemap() The code seems to have been for compatibility across d3dbdca92458 (hgweb: don't choke when an inexistent style is requested (issue1901), 2009-11-12). Differential Revision: https://phab.mercurial-scm.org/D8844
Thu, 23 Jul 2020 10:20:48 -0700 formatter: inline a variable assigned from `templater.templater.frommapfile`
Martin von Zweigbergk <martinvonz@google.com> [Thu, 23 Jul 2020 10:20:48 -0700] rev 45262
formatter: inline a variable assigned from `templater.templater.frommapfile` The variable doesn't get reused and it doesn't help formatting, so I don't see any reason for it. Differential Revision: https://phab.mercurial-scm.org/D8807
Wed, 22 Jul 2020 21:23:46 -0700 templater: don't normalize path separators to '/' when interacting with OS
Martin von Zweigbergk <martinvonz@google.com> [Wed, 22 Jul 2020 21:23:46 -0700] rev 45261
templater: don't normalize path separators to '/' when interacting with OS `_readmapfile()` is about reading a map file from the file system, so we shouldn't use our `util.normpath()`, which also normalizes `os.sep` to '/'. Differential Revision: https://phab.mercurial-scm.org/D8806
Thu, 23 Jul 2020 22:50:20 -0700 formatter: remove now-unnecessary check for file-ness
Martin von Zweigbergk <martinvonz@google.com> [Thu, 23 Jul 2020 22:50:20 -0700] rev 45260
formatter: remove now-unnecessary check for file-ness `templater.templatepath()` now returns non-`None` only for files, so the caller doesn't have to check. Differential Revision: https://phab.mercurial-scm.org/D8805
Thu, 23 Jul 2020 22:47:55 -0700 templater: make templatepath() not return directory paths
Martin von Zweigbergk <martinvonz@google.com> [Thu, 23 Jul 2020 22:47:55 -0700] rev 45259
templater: make templatepath() not return directory paths The previous patch added a test showing an unusal error message. This make it more like other error messages. Differential Revision: https://phab.mercurial-scm.org/D8804
Thu, 23 Jul 2020 22:44:18 -0700 tests: show unusual error message for `hg log --style coal`
Martin von Zweigbergk <martinvonz@google.com> [Thu, 23 Jul 2020 22:44:18 -0700] rev 45258
tests: show unusual error message for `hg log --style coal` It turns out that we show the full path when the given style name matches a subdirectory of `mercurial/templates/`. Differential Revision: https://phab.mercurial-scm.org/D8803
Wed, 22 Jul 2020 10:34:24 -0700 config: remove now-unused `abs` argument from `include` callback
Martin von Zweigbergk <martinvonz@google.com> [Wed, 22 Jul 2020 10:34:24 -0700] rev 45257
config: remove now-unused `abs` argument from `include` callback Differential Revision: https://phab.mercurial-scm.org/D8796
Wed, 22 Jul 2020 10:32:28 -0700 config: re-calculate absolute %include path in `include` callback
Martin von Zweigbergk <martinvonz@google.com> [Wed, 22 Jul 2020 10:32:28 -0700] rev 45256
config: re-calculate absolute %include path in `include` callback This removes the last user of the `abs` argument for the `include` callback. The next patch will remove the argument. Differential Revision: https://phab.mercurial-scm.org/D8795
Wed, 22 Jul 2020 10:25:28 -0700 subrepoutil: use relative path for looking up config `%include`s
Martin von Zweigbergk <martinvonz@google.com> [Wed, 22 Jul 2020 10:25:28 -0700] rev 45255
subrepoutil: use relative path for looking up config `%include`s The code was already working with relative paths in practice, since it passed in a (repo-)relative path into its local `read()` function. So all that this patch actually does is to switch to rename variables so we use the same path by a different name. This gets us closer to removing the "absolute" path from the `include` callback. Differential Revision: https://phab.mercurial-scm.org/D8794
Wed, 22 Jul 2020 00:13:02 -0700 config: remove now-unused support for "includepaths"
Martin von Zweigbergk <martinvonz@google.com> [Wed, 22 Jul 2020 00:13:02 -0700] rev 45254
config: remove now-unused support for "includepaths" This effectively undoes 081b08e4ea13 (templater: look for mapfiles in template paths, 2015-05-15). Differential Revision: https://phab.mercurial-scm.org/D8793
Sat, 25 Jul 2020 22:51:26 +0900 dispatch: adjust ui.flush() timing to stabilize test-blackbox.t stable
Yuya Nishihara <yuya@tcha.org> [Sat, 25 Jul 2020 22:51:26 +0900] rev 45253
dispatch: adjust ui.flush() timing to stabilize test-blackbox.t Without this change, dispatch.dispatch() could return before flushing all stdio data. This means chg stdio would print data after receiving the result code. --- tests/test-blackbox.t +++ tests/test-blackbox.t.err @@ -354,13 +354,13 @@ > EOF $ hg log --debug removing $TESTTMP/gone/.hg - warning: cannot write to blackbox.log: $ENOENT$ (no-windows !) warning: cannot write to blackbox.log: $TESTTMP/gone/.hg/blackbox.log: $ENOTDIR$ (windows !) $ cd .. blackbox should disable itself if track is empty $ hg --config blackbox.track= init nothing_tracked + warning: cannot write to blackbox.log: $ENOENT$ $ cd nothing_tracked $ cat >> .hg/hgrc << EOF > [blackbox]
(0) -30000 -10000 -3000 -1000 -120 +120 +1000 +3000 tip