36 def readflags(self, node): |
36 def readflags(self, node): |
37 if node == nullid: return {} # don't upset local cache |
37 if node == nullid: return {} # don't upset local cache |
38 if not self.mapcache or self.mapcache[0] != node: |
38 if not self.mapcache or self.mapcache[0] != node: |
39 self.read(node) |
39 self.read(node) |
40 return self.mapcache[2] |
40 return self.mapcache[2] |
41 |
|
42 def diff(self, a, b): |
|
43 # this is sneaky, as we're not actually using a and b |
|
44 if self.listcache and self.addlist and self.listcache[0] == a: |
|
45 d = mdiff.diff(self.listcache[1], self.addlist, 1) |
|
46 if mdiff.patch(a, d) != b: |
|
47 raise AssertionError(_("sortdiff failed!")) |
|
48 return d |
|
49 else: |
|
50 return mdiff.textdiff(a, b) |
|
51 |
41 |
52 def add(self, map, flags, transaction, link, p1=None, p2=None, |
42 def add(self, map, flags, transaction, link, p1=None, p2=None, |
53 changed=None): |
43 changed=None): |
54 # directly generate the mdiff delta from the data collected during |
44 # directly generate the mdiff delta from the data collected during |
55 # the bisect loop below |
45 # the bisect loop below |