##// END OF EJS Templates
verify: do not choke on valid changelog without manifest...
Patrick Mezard -
r17385:b32a30da stable
parent child Browse files
Show More
@@ -120,6 +120,7 b' def _verify(repo):'
120 120 havemf = len(mf) > 0
121 121
122 122 ui.status(_("checking changesets\n"))
123 hasmanifest = False
123 124 seen = {}
124 125 checklog(cl, "changelog", 0)
125 126 total = len(repo)
@@ -130,16 +131,22 b' def _verify(repo):'
130 131
131 132 try:
132 133 changes = cl.read(n)
133 mflinkrevs.setdefault(changes[0], []).append(i)
134 if changes[0] != nullid:
135 mflinkrevs.setdefault(changes[0], []).append(i)
136 hasmanifest = True
134 137 for f in changes[3]:
135 138 filelinkrevs.setdefault(f, []).append(i)
136 139 except Exception, inst:
140 hasmanifest = True
137 141 exc(i, _("unpacking changeset %s") % short(n), inst)
138 142 ui.progress(_('checking'), None)
139 143
140 144 ui.status(_("checking manifests\n"))
141 145 seen = {}
142 checklog(mf, "manifest", 0)
146 if hasmanifest:
147 # Do not check manifest if there are only changelog entries with
148 # null manifests.
149 checklog(mf, "manifest", 0)
143 150 total = len(mf)
144 151 for i in mf:
145 152 ui.progress(_('checking'), i, total=total, unit=_('manifests'))
@@ -61,10 +61,22 b' introduce some bugs in repo'
61 61 $ cd ../../..
62 62 $ cd ..
63 63
64 test revlog corruption
64 test changelog without a manifest
65 65
66 66 $ hg init b
67 67 $ cd b
68 $ hg branch foo
69 marked working directory as branch foo
70 (branches are permanent and global, did you want a bookmark?)
71 $ hg ci -m branchfoo
72 $ hg verify
73 checking changesets
74 checking manifests
75 crosschecking files in changesets and manifests
76 checking files
77 0 files, 1 changesets, 0 total revisions
78
79 test revlog corruption
68 80
69 81 $ touch a
70 82 $ hg add a
@@ -79,12 +91,12 b' test revlog corruption'
79 91 checking manifests
80 92 crosschecking files in changesets and manifests
81 93 checking files
82 a@0: broken revlog! (index data/a.i is corrupted)
94 a@1: broken revlog! (index data/a.i is corrupted)
83 95 warning: orphan revlog 'data/a.i'
84 1 files, 1 changesets, 0 total revisions
96 1 files, 2 changesets, 0 total revisions
85 97 1 warnings encountered!
86 98 1 integrity errors encountered!
87 (first damaged changeset appears to be 0)
99 (first damaged changeset appears to be 1)
88 100 [1]
89 101
90 102 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now