comparison mercurial/util.py @ 14766:4f56b7530eab stable

subrepos: be smarter about what's an absolute path (issue2808)
author Matt Mackall <mpm@selenic.com>
date Wed, 29 Jun 2011 16:01:06 -0500
parents 388af80c058b
children de9eb6b1da4f
comparison
equal deleted inserted replaced
14765:08ef6b5f3715 14766:4f56b7530eab
1553 if not self.user: 1553 if not self.user:
1554 return (s, None) 1554 return (s, None)
1555 return (s, (None, (str(self), self.host), 1555 return (s, (None, (str(self), self.host),
1556 self.user, self.passwd or '')) 1556 self.user, self.passwd or ''))
1557 1557
1558 def isabs(self):
1559 if self.scheme and self.scheme != 'file':
1560 return True # remote URL
1561 if hasdriveletter(self.path):
1562 return True # absolute for our purposes - can't be joined()
1563 if self.path.startswith(r'\\'):
1564 return True # Windows UNC path
1565 if self.path.startswith('/'):
1566 return True # POSIX-style
1567 return False
1568
1558 def localpath(self): 1569 def localpath(self):
1559 if self.scheme == 'file' or self.scheme == 'bundle': 1570 if self.scheme == 'file' or self.scheme == 'bundle':
1560 path = self.path or '/' 1571 path = self.path or '/'
1561 # For Windows, we need to promote hosts containing drive 1572 # For Windows, we need to promote hosts containing drive
1562 # letters to paths with drive letters. 1573 # letters to paths with drive letters.