##// END OF EJS Templates
url: parse fragments first (issue2997)
Matt Mackall -
r15074:64fbd0de stable
parent child Browse files
Show More
@@ -1434,6 +1434,8 b' class url(object):'
1434 <url path: 'c:\\foo\\bar'>
1434 <url path: 'c:\\foo\\bar'>
1435 >>> url(r'\\blah\blah\blah')
1435 >>> url(r'\\blah\blah\blah')
1436 <url path: '\\\\blah\\blah\\blah'>
1436 <url path: '\\\\blah\\blah\\blah'>
1437 >>> url(r'\\blah\blah\blah#baz')
1438 <url path: '\\\\blah\\blah\\blah', fragment: 'baz'>
1437
1439
1438 Authentication credentials:
1440 Authentication credentials:
1439
1441
@@ -1462,6 +1464,11 b' class url(object):'
1462 self._hostport = ''
1464 self._hostport = ''
1463 self._origpath = path
1465 self._origpath = path
1464
1466
1467 if parsefragment and '#' in path:
1468 path, self.fragment = path.split('#', 1)
1469 if not path:
1470 path = None
1471
1465 # special case for Windows drive letters and UNC paths
1472 # special case for Windows drive letters and UNC paths
1466 if hasdriveletter(path) or path.startswith(r'\\'):
1473 if hasdriveletter(path) or path.startswith(r'\\'):
1467 self.path = path
1474 self.path = path
@@ -1489,10 +1496,6 b' class url(object):'
1489 self.path = ''
1496 self.path = ''
1490 return
1497 return
1491 else:
1498 else:
1492 if parsefragment and '#' in path:
1493 path, self.fragment = path.split('#', 1)
1494 if not path:
1495 path = None
1496 if self._localpath:
1499 if self._localpath:
1497 self.path = path
1500 self.path = path
1498 return
1501 return
General Comments 0
You need to be logged in to leave comments. Login now