diff options
author | Lorry Tar Creator <lorry-tar-importer@baserock.org> | 2011-10-01 20:49:36 +0000 |
---|---|---|
committer | Lorry <lorry@roadtrain.codethink.co.uk> | 2012-09-27 13:27:51 +0000 |
commit | 921ced43c48c1d170452a7b251b94cc96ec8dd44 (patch) | |
tree | 3c4a89176ea67fe4c7bf7b375488361a823c95fa /mercurial/tags.py | |
parent | 9039c805b0a7e36220101323f82735f08a104b37 (diff) | |
download | mercurial-tarball-master.tar.gz |
Imported from /srv/lorry/lorry-area/mercurial-tarball/mercurial-1.9.3.tar.gz.HEADmercurial-1.9.3master
Diffstat (limited to 'mercurial/tags.py')
-rw-r--r-- | mercurial/tags.py | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/mercurial/tags.py b/mercurial/tags.py index e4e0129..d4047bd 100644 --- a/mercurial/tags.py +++ b/mercurial/tags.py @@ -181,7 +181,7 @@ def _readtagcache(ui, repo): for line in cachelines: if line == "\n": break - line = line.split() + line = line.rstrip().split() cacherevs.append(int(line[0])) headnode = bin(line[1]) cacheheads.append(headnode) @@ -228,11 +228,6 @@ def _readtagcache(ui, repo): # 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)] @@ -241,7 +236,7 @@ def _readtagcache(ui, repo): # This is the most expensive part of finding tags, so performance # depends primarily on the size of newheads. Worst case: no cache # file, so newheads == repoheads. - for head in reversed(newheads): + for head in newheads: cctx = repo[head] try: fnode = cctx.filenode('.hgtags') @@ -292,6 +287,6 @@ def _writetagcache(ui, repo, heads, tagfnode, cachetags): cachefile.write("%s %s\n" % (hex(node), name)) try: - cachefile.close() + cachefile.rename() except (OSError, IOError): pass |