Patchwork [3,of,3] store: pass in decoded filename to narrow matcher

login
register
mail settings
Submitter Yuya Nishihara
Date Nov. 10, 2018, 3:25 a.m.
Message ID <fda6f09aca43a1a34baf.1541820305@mimosa>
Download mbox | patch
Permalink /patch/36503/
State Accepted
Headers show

Comments

Yuya Nishihara - Nov. 10, 2018, 3:25 a.m.
# HG changeset patch
# User Yuya Nishihara <yuya@tcha.org>
# Date 1541818352 -32400
#      Sat Nov 10 11:52:32 2018 +0900
# Node ID fda6f09aca43a1a34bafc0b7e65d2f97ad76cbad
# Parent  b299e20775e4d6d504a0ed4c81de6050dd4ad191
store: pass in decoded filename to narrow matcher

Patch

diff --git a/mercurial/store.py b/mercurial/store.py
--- a/mercurial/store.py
+++ b/mercurial/store.py
@@ -427,12 +427,12 @@  class encodedstore(basicstore):
 
     def datafiles(self, matcher=None):
         for a, b, size in super(encodedstore, self).datafiles():
-            if not _matchtrackedpath(a, matcher):
-                continue
             try:
                 a = decodefilename(a)
             except KeyError:
                 a = None
+            if a is not None and not _matchtrackedpath(a, matcher):
+                continue
             yield a, b, size
 
     def join(self, f):
diff --git a/tests/test-narrow-clone-stream.t b/tests/test-narrow-clone-stream.t
--- a/tests/test-narrow-clone-stream.t
+++ b/tests/test-narrow-clone-stream.t
@@ -84,22 +84,6 @@  Making sure store has the required files
 
 Checking that repository has all the required data and not broken
 
-#if flat-nofncache
-  $ hg verify
-  checking changesets
-  checking manifests
-  crosschecking files in changesets and manifests
-  checking files
-   warning: revlog 'data/dir/src/F10.i' not in fncache!
-   9: empty or missing dir/src/F10
-   dir/src/F10@9: manifest refers to unknown revision 419ee72d626b
-  checked 40 changesets with 0 changes to 1 files
-  1 warnings encountered!
-  hint: run "hg debugrebuildfncache" to recover from corrupt fncache
-  2 integrity errors encountered!
-  (first damaged changeset appears to be 9)
-  [1]
-#else
   $ hg verify
   checking changesets
   checking manifests
@@ -107,4 +91,3 @@  Checking that repository has all the req
   crosschecking files in changesets and manifests
   checking files
   checked 40 changesets with 1 changes to 1 files
-#endif