Mercurial > public > mercurial-scm > hg
comparison mercurial/localrepo.py @ 14646:001788ef4bbb
localrepo: don't attempt to open .hgtags twice if the error isn't ENOENT
author | Idan Kamara <idankk86@gmail.com> |
---|---|
date | Wed, 15 Jun 2011 23:15:04 +0300 |
parents | 68a43fdd7d80 |
children | fdcf6f09b68d |
comparison
equal
deleted
inserted
replaced
14645:e4cfdff6d3f4 | 14646:001788ef4bbb |
---|---|
270 self.hook('tag', node=hex(node), tag=name, local=local) | 270 self.hook('tag', node=hex(node), tag=name, local=local) |
271 return | 271 return |
272 | 272 |
273 try: | 273 try: |
274 fp = self.wfile('.hgtags', 'rb+') | 274 fp = self.wfile('.hgtags', 'rb+') |
275 except IOError: | 275 except IOError, e: |
276 if e.errno != errno.ENOENT: | |
277 raise | |
276 fp = self.wfile('.hgtags', 'ab') | 278 fp = self.wfile('.hgtags', 'ab') |
277 else: | 279 else: |
278 prevtags = fp.read() | 280 prevtags = fp.read() |
279 | 281 |
280 # committed tags are stored in UTF-8 | 282 # committed tags are stored in UTF-8 |