# HG changeset patch # User Sune Foldager # Date 2009-11-02 09:15:04 # Node ID b33d70849a20930e6844ef6ce0d9d3bd823dcbe3 # Parent 57cee011ffcb32de284ae575c9b9899de1f78c43 verify: report existence of journal diff --git a/mercurial/verify.py b/mercurial/verify.py --- a/mercurial/verify.py +++ b/mercurial/verify.py @@ -7,6 +7,7 @@ from node import nullid, short from i18n import _ +import os import revlog, util, error def verify(repo): @@ -105,6 +106,9 @@ def _verify(repo): seen[n] = i return lr + if os.path.exists(repo.sjoin("journal")): + ui.warn(_("abandoned transaction found - run hg recover\n")) + revlogv1 = cl.version != revlog.REVLOGV0 if ui.verbose or not revlogv1: ui.status(_("repository uses revlog format %d\n") % 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 @@ -10,6 +10,7 @@ failed to truncate data/b.i rollback failed - please run hg recover abort: Permission denied .hg/store/data/b.i % after update 0, strip 2 +abandoned transaction found - run hg recover checking changesets checking manifests crosschecking files in changesets and manifests @@ -59,6 +60,7 @@ failed to truncate 00manifest.i rollback failed - please run hg recover abort: Permission denied .hg/store/00manifest.i % after update 0, strip 2 +abandoned transaction found - run hg recover checking changesets checking manifests manifest@?: rev 2 points to nonexistent changeset 2 diff --git a/tests/test-verify b/tests/test-verify --- a/tests/test-verify +++ b/tests/test-verify @@ -14,6 +14,12 @@ echo % verify hg verify echo +echo % verify with journal +touch .hg/store/journal +hg verify +rm .hg/store/journal + +echo echo % introduce some bugs in repo cd .hg/store/data mv _f_o_o.txt.i X_f_o_o.txt.i diff --git a/tests/test-verify.out b/tests/test-verify.out --- a/tests/test-verify.out +++ b/tests/test-verify.out @@ -10,6 +10,14 @@ crosschecking files in changesets and ma checking files 3 files, 1 changesets, 3 total revisions +% verify with journal +abandoned transaction found - run hg recover +checking changesets +checking manifests +crosschecking files in changesets and manifests +checking files +3 files, 1 changesets, 3 total revisions + % introduce some bugs in repo % verify