comparison mercurial/localrepo.py @ 15929:4091660dc130

tag: invalidate tag cache immediately after adding new tag (issue3210) New tags were written to .hgtags / .hglocaltags without updating or invalidating the localrepo cache. Before afd459933d5f a lock was acquired soon after the new tags had been written, and that invalidated the cache so the new tags for example could be seen in pretxncommit hooks. With afd459933d5f the lock had already been acquired at this point and the missing cache invalidation was exposed. The tag caches will now explicitly and immediately be invalidated when new tags are added.
author Mads Kiilerich <mads@kiilerich.com>
date Thu, 19 Jan 2012 02:14:06 +0100
parents 23921c17299a
children 4154338f0bc0
comparison
equal deleted inserted replaced
15928:3a51eb88046a 15929:4091660dc130
323 323
324 # committed tags are stored in UTF-8 324 # committed tags are stored in UTF-8
325 writetags(fp, names, encoding.fromlocal, prevtags) 325 writetags(fp, names, encoding.fromlocal, prevtags)
326 326
327 fp.close() 327 fp.close()
328
329 self.invalidatecaches()
328 330
329 if '.hgtags' not in self.dirstate: 331 if '.hgtags' not in self.dirstate:
330 self[None].add(['.hgtags']) 332 self[None].add(['.hgtags'])
331 333
332 m = matchmod.exact(self.root, '', ['.hgtags']) 334 m = matchmod.exact(self.root, '', ['.hgtags'])