Patchwork D8183: nodemap: test that an outdated nodemap can catch up

login
register
mail settings
Submitter phabricator
Date March 11, 2020, 1:35 a.m.
Message ID <ceab92b689ae7a5e391494771fd34b43@localhost.localdomain>
Download mbox | patch
Permalink /patch/45683/
State Not Applicable
Headers show

Comments

phabricator - March 11, 2020, 1:35 a.m.
marmoute added a comment.
marmoute updated this revision to Diff 20680.


  rebase above latest default up to landed-D8182

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D8183?vs=20674&id=20680

BRANCH
  default

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

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

AFFECTED FILES
  tests/test-persistent-nodemap.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-devel

Patch

diff --git a/tests/test-persistent-nodemap.t b/tests/test-persistent-nodemap.t
--- a/tests/test-persistent-nodemap.t
+++ b/tests/test-persistent-nodemap.t
@@ -190,3 +190,42 @@ 
   data-length: 122944
   data-unused: 0
 #endif
+
+Check out of sync nodemap
+=========================
+
+First copy old data on the side.
+
+  $ mkdir ../tmp-copies
+  $ cp .hg/store/00changelog-????????????????.nd .hg/store/00changelog.n ../tmp-copies
+
+Nodemap lagging behind
+----------------------
+
+make a new commit
+
+  $ echo bar2 > bar
+  $ hg ci -m 'bar2'
+  $ NODE=`hg log -r tip -T '{node}\n'`
+  $ hg log -r "$NODE" -T '{rev}\n'
+  5003
+
+If the nodemap is lagging behind, it can catch up fine
+
+  $ hg debugnodemap --metadata
+  uid: ???????????????? (glob)
+  tip-rev: 5003
+  data-length: 123200 (pure !)
+  data-length: 123200 (rust !)
+  data-length: 122944 (no-rust no-pure !)
+  data-unused: 256 (pure !)
+  data-unused: 256 (rust !)
+  data-unused: 0 (no-rust no-pure !)
+  $ cp -f ../tmp-copies/* .hg/store/
+  $ hg debugnodemap --metadata
+  uid: ???????????????? (glob)
+  tip-rev: 5002
+  data-length: 122944
+  data-unused: 0
+  $ hg log -r "$NODE" -T '{rev}\n'
+  5003