[Updated] D11282: templater: swap `\` with `/` in more location

marmoute (Pierre-Yves David) phabricator at mercurial-scm.org
Wed Aug 18 04:45:12 UTC 2021


Closed by commit rHG981cef5188c3: templater: swap `\` with `/` in more location (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/D11282?vs=29891&id=29901

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D11282/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D11282

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
@@ -833,6 +833,13 @@
 
 def _readmapfile(fp, mapfile):
     """Load template elements from the given map file"""
+    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 = mapfile.split(pycompat.ossep)
+        mapfile = b'/'.join(name_paths)
     base = os.path.dirname(mapfile)
     conf = config.config()
 



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/ed3eca01/attachment-0002.html>


More information about the Mercurial-patches mailing list