Patchwork [STABLE] statichttprepo: do not use platform path separator to build a URL

login
register
mail settings
Submitter Yuya Nishihara
Date Oct. 28, 2017, 8:38 a.m.
Message ID <ee3492423f7c8b1a350b.1509179929@mimosa>
Download mbox | patch
Permalink /patch/25299/
State Accepted
Headers show

Comments

Yuya Nishihara - Oct. 28, 2017, 8:38 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1509179032 -32400
#      Sat Oct 28 17:23:52 2017 +0900
# Branch stable
# Node ID ee3492423f7c8b1a350b2596c247e1b97759d2d7
# Parent  6e66033f91ccfb7666ec0a25d19954673269c61a
statichttprepo: do not use platform path separator to build a URL

It wouldn't work between Windows client and Unix server.

Patch

diff --git a/mercurial/statichttprepo.py b/mercurial/statichttprepo.py
--- a/mercurial/statichttprepo.py
+++ b/mercurial/statichttprepo.py
@@ -10,7 +10,6 @@ 
 from __future__ import absolute_import
 
 import errno
-import os
 
 from .i18n import _
 from . import (
@@ -20,6 +19,7 @@  from . import (
     localrepo,
     manifest,
     namespaces,
+    pathutil,
     scmutil,
     store,
     url,
@@ -99,7 +99,7 @@  def build_opener(ui, authinfo):
 
         def join(self, path):
             if path:
-                return os.path.join(self.base, path)
+                return pathutil.join(self.base, path)
             else:
                 return self.base