Patchwork D8806: templater: don't normalize path separators to '/' when interacting with OS

login
register
mail settings
Submitter phabricator
Date July 24, 2020, 6:03 a.m.
Message ID <differential-rev-PHID-DREV-cokyqu46dftctteqnybq-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/46859/
State Superseded
Headers show

Comments

phabricator - July 24, 2020, 6:03 a.m.
martinvonz created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  `_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 '/'.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/templater.py

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/mercurial/templater.py b/mercurial/templater.py
--- a/mercurial/templater.py
+++ b/mercurial/templater.py
@@ -846,15 +846,15 @@ 
     val = conf.get(b'templates', b'__base__')
     if val and val[0] not in b"'\"":
         # treat as a pointer to a base class for this style
-        path = util.normpath(os.path.join(base, val))
+        path = os.path.normpath(os.path.join(base, val))
 
         # fallback check in template paths
         if not os.path.exists(path):
-            p2 = util.normpath(os.path.join(templatedir(), val))
+            p2 = os.path.normpath(os.path.join(templatedir(), val))
             if os.path.isfile(p2):
                 path = p2
             else:
-                p3 = util.normpath(os.path.join(p2, b"map"))
+                p3 = os.path.normpath(os.path.join(p2, b"map"))
                 if os.path.isfile(p3):
                     path = p3