[PATCH 6 of 6] verify: detect manifest revs not in any changeset
Peter Arrenbrecht
peter.arrenbrecht at gmail.com
Thu May 14 09:37:13 CDT 2009
On Thu, May 14, 2009 at 4:27 PM, Peter Arrenbrecht
<peter.arrenbrecht at gmail.com> wrote:
> # HG changeset patch
> # User Peter Arrenbrecht <peter.arrenbrecht at gmail.com>
> # Date 1242310969 -7200
> # Node ID 31269fccddbda44bdf3eeaea68ca01dfa6cd82b6
> # Parent cd6d60858ce30796da62e491d6cce591cf759529
> verify: detect manifest revs not in any changeset
>
> diff --git a/mercurial/verify.py b/mercurial/verify.py
> --- a/mercurial/verify.py
> +++ b/mercurial/verify.py
> @@ -128,6 +128,8 @@
> lr = checkentry(mf, i, n, seen, mflinkrevs.get(n, []), "manifest")
> if n in mflinkrevs:
> del mflinkrevs[n]
> + else:
> + err(lr, _("%s not in changesets") % short(n), "manifest")
>
> try:
> for f, fn in mf.readdelta(n).iteritems():
> diff --git a/tests/test-repair-strip.out b/tests/test-repair-strip.out
> --- a/tests/test-repair-strip.out
> +++ b/tests/test-repair-strip.out
> @@ -62,7 +62,9 @@
> checking changesets
> checking manifests
> manifest@?: rev 2 points to nonexistent changeset 2
> + manifest@?: 3362547cdf64 not in changesets
> manifest@?: rev 3 points to nonexistent changeset 3
> + manifest@?: 265a85892ecb not in changesets
This might lead one to believe the messages are redundant, but they're
not. The existing one indicates that the manifest node's linkrev
references a non-existing changeset. The new one indicates the
manifest node is never referenced by any changeset as its manifest.
I used the same format for the new message as is used for when a file
rev is never referenced by any manifest, rather than mimicking the
message when a linkrev is not found (which is why above the seemingly
redudant messages are not formatted alike).
-parren
> crosschecking files in changesets and manifests
> c at 3: in manifest but not in changeset
> checking files
> @@ -71,7 +73,7 @@
> c@?: rev 0 points to nonexistent changeset 3
> 3 files, 2 changesets, 4 total revisions
> 1 warnings encountered!
> -5 integrity errors encountered!
> +7 integrity errors encountered!
> (first damaged changeset appears to be 3)
> % journal contents
> 00changelog.i
>
More information about the Mercurial-devel
mailing list