##// END OF EJS Templates
verify: add a hook that can let extensions manipulate file lists...
Augie Fackler -
r26900:d1c74164 default
parent child Browse files
Show More
@@ -35,6 +35,17 b' def _normpath(f):'
35 f = f.replace('//', '/')
35 f = f.replace('//', '/')
36 return f
36 return f
37
37
38 def _validpath(repo, path):
39 """Returns False if a path should NOT be treated as part of a repo.
40
41 For all in-core cases, this returns True, as we have no way for a
42 path to be mentioned in the history but not actually be
43 relevant. For narrow clones, this is important because many
44 filelogs will be missing, and changelog entries may mention
45 modified files that are outside the narrow scope.
46 """
47 return True
48
38 def _verify(repo):
49 def _verify(repo):
39 repo = repo.unfiltered()
50 repo = repo.unfiltered()
40 mflinkrevs = {}
51 mflinkrevs = {}
@@ -154,7 +165,8 b' def _verify(repo):'
154 mflinkrevs.setdefault(changes[0], []).append(i)
165 mflinkrevs.setdefault(changes[0], []).append(i)
155 refersmf = True
166 refersmf = True
156 for f in changes[3]:
167 for f in changes[3]:
157 filelinkrevs.setdefault(_normpath(f), []).append(i)
168 if _validpath(repo, f):
169 filelinkrevs.setdefault(_normpath(f), []).append(i)
158 except Exception as inst:
170 except Exception as inst:
159 refersmf = True
171 refersmf = True
160 exc(i, _("unpacking changeset %s") % short(n), inst)
172 exc(i, _("unpacking changeset %s") % short(n), inst)
@@ -181,7 +193,9 b' def _verify(repo):'
181 if not f:
193 if not f:
182 err(lr, _("file without name in manifest"))
194 err(lr, _("file without name in manifest"))
183 elif f != "/dev/null": # ignore this in very old repos
195 elif f != "/dev/null": # ignore this in very old repos
184 filenodes.setdefault(_normpath(f), {}).setdefault(fn, lr)
196 if _validpath(repo, f):
197 filenodes.setdefault(
198 _normpath(f), {}).setdefault(fn, lr)
185 except Exception as inst:
199 except Exception as inst:
186 exc(lr, _("reading manifest delta %s") % short(n), inst)
200 exc(lr, _("reading manifest delta %s") % short(n), inst)
187 ui.progress(_('checking'), None)
201 ui.progress(_('checking'), None)
General Comments 0
You need to be logged in to leave comments. Login now