diff 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
line wrap: on
line diff
--- a/mercurial/tags.py	Wed May 16 11:40:33 2012 -0500
+++ b/mercurial/tags.py	Sun May 13 12:01:52 2012 +0200
@@ -228,6 +228,11 @@
 
     # N.B. in case 4 (nodes destroyed), "new head" really means "newly
     # exposed".
+    if not len(repo.file('.hgtags')):
+        # No tags have ever been committed, so we can avoid a
+        # potentially expensive search.
+        return (repoheads, cachefnode, None, True)
+
     newheads = [head
                 for head in repoheads
                 if head not in set(cacheheads)]