comparison mercurial/ui.py @ 2495:4a2a4d988ead

make ui.expandpath better with default path.
author Vadim Gelfer <vadim.gelfer@gmail.com>
date Fri, 23 Jun 2006 18:23:32 -0700
parents 73ac95671788
children 1e2ec4fd16df
comparison
equal deleted inserted replaced
2494:73ac95671788 2495:4a2a4d988ead
200 def expandpath(self, loc, default=None): 200 def expandpath(self, loc, default=None):
201 """Return repository location relative to cwd or from [paths]""" 201 """Return repository location relative to cwd or from [paths]"""
202 if loc.find("://") != -1 or os.path.exists(loc): 202 if loc.find("://") != -1 or os.path.exists(loc):
203 return loc 203 return loc
204 204
205 return self.config("paths", loc, default or loc) 205 path = self.config("paths", loc)
206 if not path and default is not None:
207 path = self.config("paths", default)
208 return path
206 209
207 def write(self, *args): 210 def write(self, *args):
208 if self.header: 211 if self.header:
209 if self.header != self.prev_header: 212 if self.header != self.prev_header:
210 self.prev_header = self.header 213 self.prev_header = self.header