[PATCH] url: do not encode backslash in local paths (fixes 4e8f2310f310)

Adrian Buehlmann adrian at cadifra.com
Mon Mar 28 02:53:40 CDT 2011


# HG changeset patch
# User Adrian Buehlmann <adrian at cadifra.com>
# Date 1301296930 -7200
# Node ID 8f230f54126411b558125f064b3cd8f9d50f404d
# Parent  46c3043253fbd4f54bed61c4cdda2a2c198e622f
url: do not encode backslash in local paths (fixes 4e8f2310f310)

It's the canonical path separator on Windows.

BEFORE:
  $ hg out
  comparing with C:%5CUsers%5Cadi%5Chgrepos%5Ctests%5Ca
  searching for changes
  no changes found

AFTER:
  $ hg out
  comparing with C:\Users\adi\hgrepos\tests\a
  searching for changes
  no changes found

diff --git a/mercurial/url.py b/mercurial/url.py
--- a/mercurial/url.py
+++ b/mercurial/url.py
@@ -56,7 +56,7 @@ class url(object):
     """
 
     _safechars = "!~*'()+"
-    _safepchars = "/!~*'()+"
+    _safepchars = "\\/!~*'()+"
 
     def __init__(self, path, parse_query=True, parse_fragment=True):
         # We slowly chomp away at path until we have only the path left


More information about the Mercurial-devel mailing list