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.
indygreg |
hg-reviewers |
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.
Automatic diff as part of commit; lint not applicable. |
Automatic diff as part of commit; unit tests not applicable. |
Path | Packages | |||
---|---|---|---|---|
M | mercurial/templater.py (16 lines) |
Status | Author | Revision | |
---|---|---|---|
Abandoned | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz | ||
Closed | martinvonz |
def include(rel, remap, sections): | def include(rel, remap, sections): | ||||
subresource = None | subresource = None | ||||
if base: | if base: | ||||
abs = os.path.normpath(os.path.join(base, rel)) | abs = os.path.normpath(os.path.join(base, rel)) | ||||
if os.path.isfile(abs): | if os.path.isfile(abs): | ||||
subresource = util.posixfile(abs, b'rb') | subresource = util.posixfile(abs, b'rb') | ||||
if not subresource: | if not subresource: | ||||
if pycompat.ossep not in rel: | |||||
abs = rel | |||||
subresource = resourceutil.open_resource( | |||||
b'mercurial.templates', rel | |||||
) | |||||
else: | |||||
dir = templatedir() | dir = templatedir() | ||||
if dir: | if dir: | ||||
abs = os.path.normpath(os.path.join(dir, rel)) | abs = os.path.normpath(os.path.join(dir, rel)) | ||||
if os.path.isfile(abs): | if os.path.isfile(abs): | ||||
subresource = util.posixfile(abs, b'rb') | subresource = util.posixfile(abs, b'rb') | ||||
if subresource: | if subresource: | ||||
data = subresource.read() | data = subresource.read() | ||||
conf.parse( | conf.parse( | ||||
abs, data, sections=sections, remap=remap, include=include, | abs, data, sections=sections, remap=remap, include=include, | ||||
) | ) | ||||
data = fp.read() | data = fp.read() | ||||
conf.parse(mapfile, data, remap={b'': b'templates'}, include=include) | conf.parse(mapfile, data, remap={b'': b'templates'}, include=include) |