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 45337
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 45336
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 45335
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 45334
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 45333
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 45332
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 45331
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 45330
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 45329
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 45328
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 45327
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 45326
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 45325
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 45324
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 45323
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 45322
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 45321
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 45320
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 45319
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 45318
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 45317
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 45316
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 45315
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 45314
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 45313
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 45312
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 45311
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 45310
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 45309
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 45308
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 45307
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 45306
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 45305
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 45304
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 45303
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 45302
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 45301
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 45300
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 45299
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 45298
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 45297
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 45296
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 45295
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
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 45294
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 45293
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 45292
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 45291
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 45290
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 45289
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 45288
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 45287
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 45286
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 45285
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 45284
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 45283
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 45282
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 45281
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 45280
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 45279
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 45278
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
(0) -30000 -10000 -3000 -1000 -300 -100 -60 +60 +100 +300 +1000 +3000 tip