##// END OF EJS Templates
tags: loosen IOError filtering when reading localtags
Idan Kamara -
r14038:0e6f622f default
parent child Browse files
Show More
@@ -12,9 +12,9 b''
12
12
13 from node import nullid, bin, hex, short
13 from node import nullid, bin, hex, short
14 from i18n import _
14 from i18n import _
15 import os.path
16 import encoding
15 import encoding
17 import error
16 import error
17 import errno
18
18
19 def findglobaltags(ui, repo, alltags, tagtypes):
19 def findglobaltags(ui, repo, alltags, tagtypes):
20 '''Find global tags in repo by reading .hgtags from every head that
20 '''Find global tags in repo by reading .hgtags from every head that
@@ -60,15 +60,18 b' def findglobaltags(ui, repo, alltags, ta'
60 def readlocaltags(ui, repo, alltags, tagtypes):
60 def readlocaltags(ui, repo, alltags, tagtypes):
61 '''Read local tags in repo. Update alltags and tagtypes.'''
61 '''Read local tags in repo. Update alltags and tagtypes.'''
62 try:
62 try:
63 # localtags is in the local encoding; re-encode to UTF-8 on
64 # input for consistency with the rest of this module.
65 data = repo.opener("localtags").read()
63 data = repo.opener("localtags").read()
66 filetags = _readtags(
64 except IOError, inst:
67 ui, repo, data.splitlines(), "localtags",
65 if inst.errno != errno.ENOENT:
68 recode=encoding.fromlocal)
66 raise
69 _updatetags(filetags, "local", alltags, tagtypes)
67 return
70 except IOError:
68
71 pass
69 # localtags is in the local encoding; re-encode to UTF-8 on
70 # input for consistency with the rest of this module.
71 filetags = _readtags(
72 ui, repo, data.splitlines(), "localtags",
73 recode=encoding.fromlocal)
74 _updatetags(filetags, "local", alltags, tagtypes)
72
75
73 def _readtags(ui, repo, lines, fn, recode=None):
76 def _readtags(ui, repo, lines, fn, recode=None):
74 '''Read tag definitions from a file (or any source of lines).
77 '''Read tag definitions from a file (or any source of lines).
General Comments 0
You need to be logged in to leave comments. Login now