Mercurial > public > mercurial-scm > hg
diff 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 |
line wrap: on
line diff
--- a/mercurial/util.py Wed Jun 29 13:04:00 2011 +0200 +++ b/mercurial/util.py Wed Jun 29 16:01:06 2011 -0500 @@ -1555,6 +1555,17 @@ return (s, (None, (str(self), self.host), self.user, self.passwd or '')) + def isabs(self): + if self.scheme and self.scheme != 'file': + return True # remote URL + if hasdriveletter(self.path): + return True # absolute for our purposes - can't be joined() + if self.path.startswith(r'\\'): + return True # Windows UNC path + if self.path.startswith('/'): + return True # POSIX-style + return False + def localpath(self): if self.scheme == 'file' or self.scheme == 'bundle': path = self.path or '/'