Show More
@@ -9,6 +9,7 b' from revlog import *' | |||
|
9 | 9 | from i18n import gettext as _ |
|
10 | 10 | from demandload import * |
|
11 | 11 | demandload(globals(), "array bisect struct") |
|
12 | demandload(globals(), "mdiff") | |
|
12 | 13 | |
|
13 | 14 | class manifestdict(dict): |
|
14 | 15 | def __init__(self, mapping=None, flags=None): |
@@ -42,16 +43,25 b' class manifest(revlog):' | |||
|
42 | 43 | revlog.__init__(self, opener, "00manifest.i", "00manifest.d", |
|
43 | 44 | defversion) |
|
44 | 45 | |
|
46 | def parselines(self, lines): | |
|
47 | for l in lines.splitlines(1): | |
|
48 | yield l.split('\0') | |
|
49 | ||
|
50 | def readdelta(self, node): | |
|
51 | delta = mdiff.patchtext(self.delta(node)) | |
|
52 | deltamap = manifestdict() | |
|
53 | for f, n in self.parselines(delta): | |
|
54 | deltamap.rawset(f, n) | |
|
55 | return deltamap | |
|
56 | ||
|
45 | 57 | def read(self, node): |
|
46 | 58 | if node == nullid: return manifestdict() # don't upset local cache |
|
47 | 59 | if self.mapcache and self.mapcache[0] == node: |
|
48 | 60 | return self.mapcache[1] |
|
49 | 61 | text = self.revision(node) |
|
50 | 62 | self.listcache = array.array('c', text) |
|
51 | lines = text.splitlines(1) | |
|
52 | 63 | mapping = manifestdict() |
|
53 |
for |
|
|
54 | (f, n) = l.split('\0') | |
|
64 | for f, n in self.parselines(text): | |
|
55 | 65 | mapping.rawset(f, n) |
|
56 | 66 | self.mapcache = (node, mapping) |
|
57 | 67 | return mapping |
@@ -102,21 +102,15 b' def verify(repo):' | |||
|
102 | 102 | (short(n), short(p))) |
|
103 | 103 | |
|
104 | 104 | try: |
|
105 |
|
|
|
105 | for f, fn in repo.manifest.readdelta(n).iteritems(): | |
|
106 | filenodes.setdefault(f, {})[fn] = 1 | |
|
106 | 107 | except KeyboardInterrupt: |
|
107 | 108 | repo.ui.warn(_("interrupted")) |
|
108 | 109 | raise |
|
109 | 110 | except Exception, inst: |
|
110 |
err(_(" |
|
|
111 | err(_("reading delta for manifest %s: %s") % (short(n), inst)) | |
|
111 | 112 | continue |
|
112 | 113 | |
|
113 | try: | |
|
114 | ff = [ l.split('\0') for l in delta.splitlines() ] | |
|
115 | for f, fn in ff: | |
|
116 | filenodes.setdefault(f, {})[bin(fn[:40])] = 1 | |
|
117 | except (ValueError, TypeError), inst: | |
|
118 | err(_("broken delta in manifest %s: %s") % (short(n), inst)) | |
|
119 | ||
|
120 | 114 | repo.ui.status(_("crosschecking files in changesets and manifests\n")) |
|
121 | 115 | |
|
122 | 116 | for m, c in neededmanifests.items(): |
General Comments 0
You need to be logged in to leave comments.
Login now