# HG changeset patch # User Gregory Szorc # Date 2015-04-16 15:59:36 # Node ID a698e088ad29d500fdd4794a4a2fed9fee36380a # Parent 1062663808ce45610b766af650717926f253be4b tags: explicitly log which tags cache file is being written We now have multiple tags cache files. Record exactly which file is being written. This should help aid debugging into performance issues with any single filter. diff --git a/mercurial/tags.py b/mercurial/tags.py --- a/mercurial/tags.py +++ b/mercurial/tags.py @@ -355,13 +355,14 @@ def _readtagcache(ui, repo): return (repoheads, cachefnode, valid, None, True) def _writetagcache(ui, repo, valid, cachetags): + filename = _filename(repo) try: - cachefile = repo.vfs(_filename(repo), 'w', atomictemp=True) + cachefile = repo.vfs(filename, 'w', atomictemp=True) except (OSError, IOError): return - ui.log('tagscache', 'writing tags cache file with %d tags\n', - len(cachetags)) + ui.log('tagscache', 'writing .hg/%s with %d tags\n', + filename, len(cachetags)) if valid[2]: cachefile.write('%d %s %s\n' % (valid[0], hex(valid[1]), hex(valid[2]))) diff --git a/tests/test-blackbox.t b/tests/test-blackbox.t --- a/tests/test-blackbox.t +++ b/tests/test-blackbox.t @@ -123,7 +123,7 @@ extension and python hooks - use the eol 1 files updated, 0 files merged, 0 files removed, 0 files unresolved $ hg blackbox -l 5 1970/01/01 00:00:00 bob> update - 1970/01/01 00:00:00 bob> writing tags cache file with 0 tags + 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 0 tags 1970/01/01 00:00:00 bob> pythonhook-preupdate: hgext.eol.preupdate finished in * seconds (glob) 1970/01/01 00:00:00 bob> exthook-update: echo hooked finished in * seconds (glob) 1970/01/01 00:00:00 bob> update exited 0 after * seconds (glob) diff --git a/tests/test-mq.t b/tests/test-mq.t --- a/tests/test-mq.t +++ b/tests/test-mq.t @@ -311,12 +311,12 @@ qpop qpush with dump of tag cache Dump the tag cache to ensure that it has exactly one head after qpush. - $ rm -f .hg/cache/tags-visible + $ rm -f .hg/cache/tags2-visible $ hg tags > /dev/null -.hg/cache/tags-visible (pre qpush): +.hg/cache/tags2-visible (pre qpush): - $ cat .hg/cache/tags-visible + $ cat .hg/cache/tags2-visible 1 [\da-f]{40} (re) $ hg qpush applying test.patch @@ -325,9 +325,9 @@ Dump the tag cache to ensure that it has 2: draft $ hg tags > /dev/null -.hg/cache/tags-visible (post qpush): +.hg/cache/tags2-visible (post qpush): - $ cat .hg/cache/tags-visible + $ cat .hg/cache/tags2-visible 2 [\da-f]{40} (re) $ checkundo qpush $ cd .. diff --git a/tests/test-obsolete-tag-cache.t b/tests/test-obsolete-tag-cache.t --- a/tests/test-obsolete-tag-cache.t +++ b/tests/test-obsolete-tag-cache.t @@ -70,7 +70,7 @@ Hiding a non-tip changeset should change $ hg blackbox -l 4 1970/01/01 00:00:00 bob> tags 1970/01/01 00:00:00 bob> 2/2 cache hits/lookups in * seconds (glob) - 1970/01/01 00:00:00 bob> writing tags cache file with 2 tags + 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 2 tags 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) Hiding another changeset should cause the filtered hash to change @@ -89,7 +89,7 @@ Hiding another changeset should cause th $ hg blackbox -l 4 1970/01/01 00:00:00 bob> tags 1970/01/01 00:00:00 bob> 1/1 cache hits/lookups in * seconds (glob) - 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags + 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) Resolving tags on an unfiltered repo writes a separate tags cache @@ -109,5 +109,5 @@ Resolving tags on an unfiltered repo wri $ hg blackbox -l 4 1970/01/01 00:00:00 bob> --hidden tags 1970/01/01 00:00:00 bob> 2/2 cache hits/lookups in * seconds (glob) - 1970/01/01 00:00:00 bob> writing tags cache file with 3 tags + 1970/01/01 00:00:00 bob> writing .hg/cache/tags2 with 3 tags 1970/01/01 00:00:00 bob> --hidden tags exited 0 after * seconds (glob) diff --git a/tests/test-tags.t b/tests/test-tags.t --- a/tests/test-tags.t +++ b/tests/test-tags.t @@ -133,7 +133,7 @@ Tag cache debug info written to blackbox 1970/01/01 00:00:00 bob> identify 1970/01/01 00:00:00 bob> writing 48 bytes to cache/hgtagsfnodes1 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob) - 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags + 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags 1970/01/01 00:00:00 bob> identify exited 0 after ?.?? seconds (glob) Failure to acquire lock results in no write @@ -146,7 +146,7 @@ Failure to acquire lock results in no wr 1970/01/01 00:00:00 bob> identify 1970/01/01 00:00:00 bob> not writing .hg/cache/hgtagsfnodes1 because lock held 1970/01/01 00:00:00 bob> 0/1 cache hits/lookups in * seconds (glob) - 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags + 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags 1970/01/01 00:00:00 bob> identify exited 0 after * seconds (glob) $ fnodescacheexists @@ -343,7 +343,7 @@ Extra junk data at the end should get ov 1970/01/01 00:00:00 bob> tags 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob) - 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags + 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) #if unix-permissions no-root @@ -363,7 +363,7 @@ Errors writing to .hgtags fnodes cache a 1970/01/01 00:00:00 bob> tags 1970/01/01 00:00:00 bob> couldn't write cache/hgtagsfnodes1: [Errno 13] Permission denied: '$TESTTMP/t2/.hg/cache/hgtagsfnodes1' 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob) - 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags + 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) $ chmod a+w .hg/cache/hgtagsfnodes1 @@ -378,7 +378,7 @@ Errors writing to .hgtags fnodes cache a 1970/01/01 00:00:00 bob> tags 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob) - 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags + 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) $ f --size .hg/cache/hgtagsfnodes1 @@ -394,7 +394,7 @@ Stripping doesn't truncate the tags cach $ hg blackbox -l 4 1970/01/01 00:00:00 bob> tags 1970/01/01 00:00:00 bob> 3/3 cache hits/lookups in * seconds (glob) - 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags + 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) $ f --size .hg/cache/hgtagsfnodes1 @@ -411,7 +411,7 @@ Stripping doesn't truncate the tags cach 1970/01/01 00:00:00 bob> tags 1970/01/01 00:00:00 bob> writing 24 bytes to cache/hgtagsfnodes1 1970/01/01 00:00:00 bob> 2/3 cache hits/lookups in * seconds (glob) - 1970/01/01 00:00:00 bob> writing tags cache file with 1 tags + 1970/01/01 00:00:00 bob> writing .hg/cache/tags2-visible with 1 tags 1970/01/01 00:00:00 bob> tags exited 0 after * seconds (glob) $ f --size .hg/cache/hgtagsfnodes1 .hg/cache/hgtagsfnodes1: size=144