Patchwork D9810: persistent-nodemap: also exchange the nodemap data over the wire

login
register
mail settings
Submitter phabricator
Date Jan. 17, 2021, 7:29 p.m.
Message ID <differential-rev-PHID-DREV-sac62p3rohu6mfufzpuk-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/48121/
State Superseded
Headers show

Comments

phabricator - Jan. 17, 2021, 7:29 p.m.
marmoute created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  It appears that 2 bytes are never equals to 3 bytes.

REPOSITORY
  rHG Mercurial

BRANCH
  default

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

AFFECTED FILES
  mercurial/store.py
  tests/test-persistent-nodemap.t

CHANGE DETAILS




To: marmoute, #hg-reviewers
Cc: mercurial-patches, 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
@@ -707,9 +707,11 @@ 
   adding [s] 00manifest.n (70 bytes)
   adding [s] 00manifest.i (313 KB)
   adding [s] 00manifest.d (452 KB)
+  adding [s] 00manifest-*.nd (118 KB) (glob)
   adding [s] 00changelog.n (70 bytes)
   adding [s] 00changelog.i (313 KB)
   adding [s] 00changelog.d (360 KB)
+  adding [s] 00changelog-*.nd (118 KB) (glob)
   $ ls -1 stream-clone/.hg/store/ | egrep '00(changelog|manifest)(\.n|-.*\.nd)'
   00changelog-*.nd (glob)
   00changelog.n
diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -389,7 +389,11 @@ 
 
 
 def isrevlog(f, kind, st):
-    return kind == stat.S_IFREG and f[-2:] in (b'.i', b'.d', b'.n', b'.nd')
+    if kind != stat.S_IFREG:
+        return False
+    if f[-2:] in (b'.i', b'.d', b'.n'):
+        return True
+    return f[-3:] == b'.nd'
 
 
 class basicstore(object):