equal
deleted
inserted
replaced
9 |
9 |
10 import os |
10 import os |
11 |
11 |
12 from . import ( |
12 from . import ( |
13 encoding, |
13 encoding, |
14 osutil, |
|
15 pycompat, |
14 pycompat, |
16 util, |
15 util, |
17 ) |
16 ) |
18 |
17 |
19 if pycompat.osname == 'nt': |
18 if pycompat.osname == 'nt': |
28 def _expandrcpath(path): |
27 def _expandrcpath(path): |
29 '''path could be a file or a directory. return a list of file paths''' |
28 '''path could be a file or a directory. return a list of file paths''' |
30 p = util.expandpath(path) |
29 p = util.expandpath(path) |
31 if os.path.isdir(p): |
30 if os.path.isdir(p): |
32 join = os.path.join |
31 join = os.path.join |
33 return [join(p, f) for f, k in osutil.listdir(p) if f.endswith('.rc')] |
32 return [join(p, f) for f, k in util.listdir(p) if f.endswith('.rc')] |
34 return [p] |
33 return [p] |
35 |
34 |
36 def envrcitems(env=None): |
35 def envrcitems(env=None): |
37 '''Return [(section, name, value, source)] config items. |
36 '''Return [(section, name, value, source)] config items. |
38 |
37 |