2 parents ce418b4 + 0e1a5b4 commit 9e66ac6Copy full SHA for 9e66ac6
1 file changed
Tools/hg/hgtouch.py
@@ -7,15 +7,19 @@
7
8
In addition to the dependency syntax, #-comments are supported.
9
"""
10
+import errno
11
import os
12
13
def parse_config(repo):
- configfile = repo.wjoin(".hgtouch")
14
- if not os.path.exists(configfile):
+ try:
15
+ fp = repo.wfile(".hgtouch")
16
+ except IOError, e:
17
+ if e.errno != errno.ENOENT:
18
+ raise
19
return {}
20
result = {}
- with open(configfile) as f:
- for line in f:
21
+ with fp:
22
+ for line in fp:
23
# strip comments
24
line = line.split('#')[0].strip()
25
if ':' not in line:
0 commit comments