##// END OF EJS Templates
manifest: convert sys.stderr bits to AssertionError
mpm@selenic.com -
r1098:50a0a36d default
parent child Browse files
Show More
@@ -43,8 +43,7 b' class manifest(revlog):'
43 if self.listcache and self.addlist and self.listcache[0] == a:
43 if self.listcache and self.addlist and self.listcache[0] == a:
44 d = mdiff.diff(self.listcache[1], self.addlist, 1)
44 d = mdiff.diff(self.listcache[1], self.addlist, 1)
45 if mdiff.patch(a, d) != b:
45 if mdiff.patch(a, d) != b:
46 sys.stderr.write("*** sortdiff failed, falling back ***\n")
46 raise AssertionError("sortdiff failed!")
47 return mdiff.textdiff(a, b)
48 return d
47 return d
49 else:
48 else:
50 return mdiff.textdiff(a, b)
49 return mdiff.textdiff(a, b)
@@ -144,9 +143,8 b' class manifest(revlog):'
144 # item not found, insert a new one
143 # item not found, insert a new one
145 end = bs
144 end = bs
146 if w[1] == 1:
145 if w[1] == 1:
147 sys.stderr.write("failed to remove %s from manifest\n"
146 raise AssertionError(
148 % f)
147 "failed to remove %s from manifest\n" % f)
149 sys.exit(1)
150 else:
148 else:
151 # item is found, replace/delete the existing line
149 # item is found, replace/delete the existing line
152 end = bs + 1
150 end = bs + 1
@@ -160,8 +158,7 b' class manifest(revlog):'
160
158
161 text = "".join(self.addlist)
159 text = "".join(self.addlist)
162 if cachedelta and mdiff.patch(self.listcache[0], cachedelta) != text:
160 if cachedelta and mdiff.patch(self.listcache[0], cachedelta) != text:
163 sys.stderr.write("manifest delta failure\n")
161 raise AssertionError("manifest delta failure\n")
164 sys.exit(1)
165 n = self.addrevision(text, transaction, link, p1, p2, cachedelta)
162 n = self.addrevision(text, transaction, link, p1, p2, cachedelta)
166 self.mapcache = (n, map, flags)
163 self.mapcache = (n, map, flags)
167 self.listcache = (text, self.addlist)
164 self.listcache = (text, self.addlist)
General Comments 0
You need to be logged in to leave comments. Login now