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
(0) -30000 -10000 -3000 -1000 -300 -100 -15 +15 +100 +300 +1000 +3000 tip