Show More
@@ -7,7 +7,7 b'' | |||||
7 |
|
7 | |||
8 | from node import nullid, short |
|
8 | from node import nullid, short | |
9 | from i18n import _ |
|
9 | from i18n import _ | |
10 |
import os |
|
10 | import os | |
11 | import revlog, util, error |
|
11 | import revlog, util, error | |
12 |
|
12 | |||
13 | def verify(repo): |
|
13 | def verify(repo): | |
@@ -17,6 +17,13 b' def verify(repo):' | |||||
17 | finally: |
|
17 | finally: | |
18 | lock.release() |
|
18 | lock.release() | |
19 |
|
19 | |||
|
20 | def _normpath(f): | |||
|
21 | # under hg < 2.4, convert didn't sanitize paths properly, so a | |||
|
22 | # converted repo may contain repeated slashes | |||
|
23 | while '//' in f: | |||
|
24 | f = f.replace('//', '/') | |||
|
25 | return f | |||
|
26 | ||||
20 | def _verify(repo): |
|
27 | def _verify(repo): | |
21 | mflinkrevs = {} |
|
28 | mflinkrevs = {} | |
22 | filelinkrevs = {} |
|
29 | filelinkrevs = {} | |
@@ -135,7 +142,7 b' def _verify(repo):' | |||||
135 | mflinkrevs.setdefault(changes[0], []).append(i) |
|
142 | mflinkrevs.setdefault(changes[0], []).append(i) | |
136 | refersmf = True |
|
143 | refersmf = True | |
137 | for f in changes[3]: |
|
144 | for f in changes[3]: | |
138 | filelinkrevs.setdefault(f, []).append(i) |
|
145 | filelinkrevs.setdefault(_normpath(f), []).append(i) | |
139 | except Exception, inst: |
|
146 | except Exception, inst: | |
140 | refersmf = True |
|
147 | refersmf = True | |
141 | exc(i, _("unpacking changeset %s") % short(n), inst) |
|
148 | exc(i, _("unpacking changeset %s") % short(n), inst) | |
@@ -162,7 +169,7 b' def _verify(repo):' | |||||
162 | if not f: |
|
169 | if not f: | |
163 | err(lr, _("file without name in manifest")) |
|
170 | err(lr, _("file without name in manifest")) | |
164 | elif f != "/dev/null": |
|
171 | elif f != "/dev/null": | |
165 | filenodes.setdefault(f, {}).setdefault(fn, lr) |
|
172 | filenodes.setdefault(_normpath(f), {}).setdefault(fn, lr) | |
166 | except Exception, inst: |
|
173 | except Exception, inst: | |
167 | exc(lr, _("reading manifest delta %s") % short(n), inst) |
|
174 | exc(lr, _("reading manifest delta %s") % short(n), inst) | |
168 | ui.progress(_('checking'), None) |
|
175 | ui.progress(_('checking'), None) | |
@@ -209,7 +216,7 b' def _verify(repo):' | |||||
209 | if not f: |
|
216 | if not f: | |
210 | err(None, _("cannot decode filename '%s'") % f2) |
|
217 | err(None, _("cannot decode filename '%s'") % f2) | |
211 | elif size > 0 or not revlogv1: |
|
218 | elif size > 0 or not revlogv1: | |
212 | storefiles.add(f) |
|
219 | storefiles.add(_normpath(f)) | |
213 |
|
220 | |||
214 | files = sorted(set(filenodes) | set(filelinkrevs)) |
|
221 | files = sorted(set(filenodes) | set(filelinkrevs)) | |
215 | total = len(files) |
|
222 | total = len(files) | |
@@ -236,12 +243,7 b' def _verify(repo):' | |||||
236 | try: |
|
243 | try: | |
237 | storefiles.remove(ff) |
|
244 | storefiles.remove(ff) | |
238 | except KeyError: |
|
245 | except KeyError: | |
239 | # under hg < 2.4, convert didn't sanitize paths properly, |
|
246 | err(lr, _("missing revlog!"), ff) | |
240 | # so a converted repo may contain repeated slashes |
|
|||
241 | try: |
|
|||
242 | storefiles.remove(posixpath.normpath(ff)) |
|
|||
243 | except KeyError: |
|
|||
244 | err(lr, _("missing revlog!"), ff) |
|
|||
245 |
|
247 | |||
246 | checklog(fl, f, lr) |
|
248 | checklog(fl, f, lr) | |
247 | seen = {} |
|
249 | seen = {} |
General Comments 0
You need to be logged in to leave comments.
Login now