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
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
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
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
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
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
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
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
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
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
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
Augie Fackler <augie@google.com> [Wed, 05 Aug 2020 13:36:50 -0400] rev 45302
merge with stable
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
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
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
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