##// END OF EJS Templates
subrepos: be smarter about what's an absolute path (issue2808)
Matt Mackall -
r14766:4f56b753 stable
parent child Browse files
Show More
@@ -198,9 +198,9 b' def _abssource(repo, push=False, abort=T'
198 or on the top repo config. Abort or return None if no source found."""
198 or on the top repo config. Abort or return None if no source found."""
199 if hasattr(repo, '_subparent'):
199 if hasattr(repo, '_subparent'):
200 source = util.url(repo._subsource)
200 source = util.url(repo._subsource)
201 if source.isabs():
202 return str(source)
201 source.path = posixpath.normpath(source.path)
203 source.path = posixpath.normpath(source.path)
202 if posixpath.isabs(source.path) or source.scheme:
203 return str(source)
204 parent = _abssource(repo._subparent, push, abort=False)
204 parent = _abssource(repo._subparent, push, abort=False)
205 if parent:
205 if parent:
206 parent = util.url(parent)
206 parent = util.url(parent)
@@ -1555,6 +1555,17 b' class url(object):'
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 '/'
General Comments 0
You need to be logged in to leave comments. Login now