[PATCH 11 of 15 RFC] verify: treat manifest nodes existing in manifest as known at partial verification
FUJIWARA Katsunori
foozy at lares.dti.ne.jp
Wed Oct 3 16:39:08 UTC 2012
# HG changeset patch
# User FUJIWARA Katsunori <foozy at lares.dti.ne.jp>
# Date 1349281445 -32400
# Node ID b54e1c7827847f115d0291daeec8a16f3a6bb170
# Parent c65f1bffe4bf01bdb672691a2390be0c2164bf8a
verify: treat manifest nodes existing in manifest as known at partial verification
At whole repository verification, changelog/manifest crosschecking
consists of steps below:
1. put manifest nodes referred from all verification target
changelog entries into "mflinkrevs"
2. remove nodes of all verification target manifest entries from
"mflinkrevs"
3. treat manifest nodes still left in "mflinkrevs" as "changeset
refers to unknown manifest"
At partial verification, any of verification target changelog entries
may refer to manifest entry which is not verification target: for
example, the revision creating new named branch refers already
existing manifest entry.
In such case, manifest nodes put in step (1) are not removed in step
(2), so such manifest nodes cause verification error.
This patch treats manifest nodes as known ones, if manifest node
exists in "manifest" file at partial verification.
diff -r c65f1bffe4bf -r b54e1c782784 mercurial/verify.py
--- a/mercurial/verify.py Thu Oct 04 01:24:05 2012 +0900
+++ b/mercurial/verify.py Thu Oct 04 01:24:05 2012 +0900
@@ -192,13 +192,18 @@
ui.status(_("crosschecking files in changesets and manifests\n"))
+ if partially:
+ knownmfn = lambda mfn: mf.hasnode(mfn)
+ else:
+ knownmfn = lambda mfn: False
+
total = len(mflinkrevs) + len(filelinkrevs) + len(filenodes)
count = 0
if havemf:
for c, m in sorted([(c, m) for m in mflinkrevs
for c in mflinkrevs[m]]):
count += 1
- if m == nullid:
+ if m == nullid or knownmfn(m):
continue
ui.progress(_('crosschecking'), count, total=total)
err(c, _("changeset refers to unknown manifest %s") % short(m))
More information about the Mercurial-devel
mailing list