changeset 14699:388af80c058b stable

url: catch UNC paths as yet another Windows special case (issue2808)
author Matt Mackall <mpm@selenic.com>
date Mon, 20 Jun 2011 16:45:33 -0500
parents df902fe3d79e
children 848a6658069e
files mercurial/util.py
diffstat 1 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/util.py	Mon Jun 20 14:11:01 2011 +0200
+++ b/mercurial/util.py	Mon Jun 20 16:45:33 2011 -0500
@@ -1359,6 +1359,8 @@
     <url scheme: 'bundle', path: '../foo'>
     >>> url(r'c:\foo\bar')
     <url path: 'c:\\foo\\bar'>
+    >>> url(r'\\blah\blah\blah')
+    <url path: '\\\\blah\\blah\\blah'>
 
     Authentication credentials:
 
@@ -1387,8 +1389,8 @@
         self._hostport = ''
         self._origpath = path
 
-        # special case for Windows drive letters
-        if hasdriveletter(path):
+        # special case for Windows drive letters and UNC paths
+        if hasdriveletter(path) or path.startswith(r'\\'):
             self.path = path
             return