mercurial/ui.py
changeset 2579 0875cda033fd
parent 2502 18cf95ad3666
child 2580 a20a1bb0c396
equal deleted inserted replaced
2578:cf4f0322851d 2579:0875cda033fd
    74                 raise util.Abort(_("Failed to parse %s\n%s") % (f, inst))
    74                 raise util.Abort(_("Failed to parse %s\n%s") % (f, inst))
    75         # translate paths relative to root (or home) into absolute paths
    75         # translate paths relative to root (or home) into absolute paths
    76         if root is None:
    76         if root is None:
    77             root = os.path.expanduser('~')
    77             root = os.path.expanduser('~')
    78         for name, path in self.configitems("paths"):
    78         for name, path in self.configitems("paths"):
    79             if path and path.find("://") == -1 and not os.path.isabs(path):
    79             if path and "://" not in path and not os.path.isabs(path):
    80                 self.cdata.set("paths", name, os.path.join(root, path))
    80                 self.cdata.set("paths", name, os.path.join(root, path))
    81 
    81 
    82     def setconfig(self, section, name, val):
    82     def setconfig(self, section, name, val):
    83         self.overlay[(section, name)] = val
    83         self.overlay[(section, name)] = val
    84 
    84 
   206         if not self.verbose: user = util.shortuser(user)
   206         if not self.verbose: user = util.shortuser(user)
   207         return user
   207         return user
   208 
   208 
   209     def expandpath(self, loc, default=None):
   209     def expandpath(self, loc, default=None):
   210         """Return repository location relative to cwd or from [paths]"""
   210         """Return repository location relative to cwd or from [paths]"""
   211         if loc.find("://") != -1 or os.path.exists(loc):
   211         if "://" in loc or os.path.exists(loc):
   212             return loc
   212             return loc
   213 
   213 
   214         path = self.config("paths", loc)
   214         path = self.config("paths", loc)
   215         if not path and default is not None:
   215         if not path and default is not None:
   216             path = self.config("paths", default)
   216             path = self.config("paths", default)