mercurial/util.py
branchstable
changeset 15018 e89f62dcd723
parent 14988 e6730f9e13bc
child 15024 0f1311e829c9
equal deleted inserted replaced
15007:9991f8b19ff3 15018:e89f62dcd723
  1442                 else:
  1442                 else:
  1443                     self.host = parts[0]
  1443                     self.host = parts[0]
  1444                     path = None
  1444                     path = None
  1445                 if not self.host:
  1445                 if not self.host:
  1446                     self.host = None
  1446                     self.host = None
       
  1447                     # path of file:///d is /d
       
  1448                     # path of file:///d:/ is d:/, not /d:/
  1447                     if path and not hasdriveletter(path):
  1449                     if path and not hasdriveletter(path):
  1448                         path = '/' + path
  1450                         path = '/' + path
  1449 
  1451 
  1450             if self.host and '@' in self.host:
  1452             if self.host and '@' in self.host:
  1451                 self.user, self.host = self.host.rsplit('@', 1)
  1453                 self.user, self.host = self.host.rsplit('@', 1)
  1584             # letters to paths with drive letters.
  1586             # letters to paths with drive letters.
  1585             if hasdriveletter(self._hostport):
  1587             if hasdriveletter(self._hostport):
  1586                 path = self._hostport + '/' + self.path
  1588                 path = self._hostport + '/' + self.path
  1587             elif self.host is not None and self.path:
  1589             elif self.host is not None and self.path:
  1588                 path = '/' + path
  1590                 path = '/' + path
  1589             # We also need to handle the case of file:///C:/, which
       
  1590             # should return C:/, not /C:/.
       
  1591             elif hasdriveletter(path):
       
  1592                 # Strip leading slash from paths with drive names
       
  1593                 return path[1:]
       
  1594             return path
  1591             return path
  1595         return self._origpath
  1592         return self._origpath
  1596 
  1593 
  1597 def hasscheme(path):
  1594 def hasscheme(path):
  1598     return bool(url(path).scheme)
  1595     return bool(url(path).scheme)