mercurial/util.py
changeset 9610 d78fe60f6bda
parent 9569 ceb0f59e1327
child 9632 16698d87ad20
equal deleted inserted replaced
9609:aa404f3f661b 9610:d78fe60f6bda
  1156     if _rcpath is None:
  1156     if _rcpath is None:
  1157         if 'HGRCPATH' in os.environ:
  1157         if 'HGRCPATH' in os.environ:
  1158             _rcpath = []
  1158             _rcpath = []
  1159             for p in os.environ['HGRCPATH'].split(os.pathsep):
  1159             for p in os.environ['HGRCPATH'].split(os.pathsep):
  1160                 if not p: continue
  1160                 if not p: continue
       
  1161                 p = expandpath(p)
  1161                 if os.path.isdir(p):
  1162                 if os.path.isdir(p):
  1162                     for f, kind in osutil.listdir(p):
  1163                     for f, kind in osutil.listdir(p):
  1163                         if f.endswith('.rc'):
  1164                         if f.endswith('.rc'):
  1164                             _rcpath.append(os.path.join(p, f))
  1165                             _rcpath.append(os.path.join(p, f))
  1165                 else:
  1166                 else:
  1248 
  1249 
  1249 def iterlines(iterator):
  1250 def iterlines(iterator):
  1250     for chunk in iterator:
  1251     for chunk in iterator:
  1251         for line in chunk.splitlines():
  1252         for line in chunk.splitlines():
  1252             yield line
  1253             yield line
       
  1254 
       
  1255 def expandpath(path):
       
  1256     return os.path.expanduser(os.path.expandvars(path))