39 |
42 |
40 def wraprevision(orig, self, nodeorrev, *args, **kwargs): |
43 def wraprevision(orig, self, nodeorrev, *args, **kwargs): |
41 text = orig(self, nodeorrev, *args, **kwargs) |
44 text = orig(self, nodeorrev, *args, **kwargs) |
42 if getattr(self, 'sidedatanocheck', False): |
45 if getattr(self, 'sidedatanocheck', False): |
43 return text |
46 return text |
44 if nodeorrev != node.nullrev and nodeorrev != node.nullid: |
47 if nodeorrev != nullrev and nodeorrev != nullid: |
45 sd = self.sidedata(nodeorrev) |
48 sd = self.sidedata(nodeorrev) |
46 if len(text) != struct.unpack('>I', sd[sidedata.SD_TEST1])[0]: |
49 if len(text) != struct.unpack('>I', sd[sidedata.SD_TEST1])[0]: |
47 raise RuntimeError('text size mismatch') |
50 raise RuntimeError('text size mismatch') |
48 expected = sd[sidedata.SD_TEST2] |
51 expected = sd[sidedata.SD_TEST2] |
49 got = hashlib.sha256(text).digest() |
52 got = hashlib.sha256(text).digest() |