[Updated] D11281: templater: swap `\` with `/` to allow the resource logic to kicks in
marmoute (Pierre-Yves David)
phabricator at mercurial-scm.org
Wed Aug 18 04:45:08 UTC 2021
Closed by commit rHG7ab7f73a7f0a: templater: swap `\` with `/` to allow the resource logic to kicks in (authored by marmoute).
This revision was automatically updated to reflect the committed changes.
This revision was not accepted when it landed; it landed in state "Needs Review".
REPOSITORY
rHG Mercurial
CHANGES SINCE LAST UPDATE
https://phab.mercurial-scm.org/D11281?vs=29890&id=29900
CHANGES SINCE LAST ACTION
https://phab.mercurial-scm.org/D11281/new/
REVISION DETAIL
https://phab.mercurial-scm.org/D11281
AFFECTED FILES
mercurial/templater.py
CHANGE DETAILS
diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -1117,6 +1117,13 @@
return f, open(f, mode='rb')
# Otherwise try to read it using the resources API
+ if pycompat.iswindows:
+ # quick hack to make sure we can process '/' in the code dealing with
+ # ressource. Ideally we would make sure we use `/` instead of `ossep`
+ # in the templater code, but that seems a bigger and less certain
+ # change that we better left for the default branch.
+ name_paths = name.split(pycompat.ossep)
+ name = b'/'.join(name_paths)
name_parts = name.split(b'/')
package_name = b'.'.join([b'mercurial', b'templates'] + name_parts[:-1])
return (
To: marmoute, #hg-reviewers
Cc: mercurial-patches
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurial-scm.org/pipermail/mercurial-patches/attachments/20210818/54bee9fb/attachment-0002.html>
More information about the Mercurial-patches
mailing list