comparison mercurial/tags.py @ 16730:dd4ce44ff53c

tags: short-circuit if no tags have ever been committed
author Bryan O'Sullivan <bryano@fb.com>
date Sun, 13 May 2012 12:01:52 +0200
parents fe9a53726484
children 707cbbf950ea
comparison
equal deleted inserted replaced
16729:46c15dff3497 16730:dd4ce44ff53c
226 226
227 # As it happens, the code to handle cases 3, 4, 5 is the same. 227 # As it happens, the code to handle cases 3, 4, 5 is the same.
228 228
229 # N.B. in case 4 (nodes destroyed), "new head" really means "newly 229 # N.B. in case 4 (nodes destroyed), "new head" really means "newly
230 # exposed". 230 # exposed".
231 if not len(repo.file('.hgtags')):
232 # No tags have ever been committed, so we can avoid a
233 # potentially expensive search.
234 return (repoheads, cachefnode, None, True)
235
231 newheads = [head 236 newheads = [head
232 for head in repoheads 237 for head in repoheads
233 if head not in set(cacheheads)] 238 if head not in set(cacheheads)]
234 239
235 # Now we have to lookup the .hgtags filenode for every new head. 240 # Now we have to lookup the .hgtags filenode for every new head.