Patchwork D8094: tags: show how hg behaves if a tags cache entry is truncated

login
register
mail settings
Submitter phabricator
Date Feb. 10, 2020, 6:02 p.m.
Message ID <bb69cc2a30bd954b033c93d8fa17d95d@localhost.localdomain>
Download mbox | patch
Permalink /patch/45076/
State Not Applicable
Headers show

Comments

phabricator - Feb. 10, 2020, 6:02 p.m.
Closed by commit rHG89d44cfcdeeb: tags: show how hg behaves if a tags cache entry is truncated (authored by valentin.gatienbaron).
This revision was automatically updated to reflect the committed changes.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8094?vs=19996&id=20055

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8094/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8094

AFFECTED FILES
  tests/test-tags.t

CHANGE DETAILS




To: valentin.gatienbaron, #hg-reviewers, pulkit
Cc: mercurial-devel

Patch

diff --git a/tests/test-tags.t b/tests/test-tags.t
--- a/tests/test-tags.t
+++ b/tests/test-tags.t
@@ -371,6 +371,26 @@ 
   1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> tags exited 0 after * seconds (glob)
   1970/01/01 00:00:00 bob @8dbfe60eff306a54259cfe007db9e330e7ecf866 (5000)> blackbox -l 6
 
+Junk data + missing cache entries results in hg further corrupting the
+cache, then failing.
+
+  $ rm -f .hg/cache/tags2-visible
+  $ truncate .hg/cache/hgtagsfnodes1 -s -10
+  $ hg debugtagscache | tail -2
+  4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
+  5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8af31de17fab7ffffffffffffffffffff
+  $ hg tags
+  abort: data/.hgtags.i@0c04f2a8af31: no match found!
+  [255]
+  $ hg debugtagscache | tail -2
+  4 0c192d7d5e6b78a714de54a2e9627952a877e25a 0c04f2a8af31de17fab7422878ee5a2dadbc943d
+  5 8dbfe60eff306a54259cfe007db9e330e7ecf866 0c04f2a8af31de17fab7ffffffffffffffffffff
+# fix up the cache
+  $ rm .hg/cache/hgtagsfnodes1
+  $ hg tags -q
+  tip
+  bar
+
 #if unix-permissions no-root
 Errors writing to .hgtags fnodes cache are silently ignored