Show More
@@ -64,6 +64,8 b' class filelog(revlog.revlog):' | |||||
64 | node = self.node(rev) |
|
64 | node = self.node(rev) | |
65 | if self.renamed(node): |
|
65 | if self.renamed(node): | |
66 | return len(self.read(node)) |
|
66 | return len(self.read(node)) | |
|
67 | if self._iscensored(rev): | |||
|
68 | return 0 | |||
67 |
|
69 | |||
68 | # XXX if self.read(node).startswith("\1\n"), this returns (size+4) |
|
70 | # XXX if self.read(node).startswith("\1\n"), this returns (size+4) | |
69 | return super(filelog, self).size(rev) |
|
71 | return super(filelog, self).size(rev) | |
@@ -82,6 +84,10 b' class filelog(revlog.revlog):' | |||||
82 | if samehashes: |
|
84 | if samehashes: | |
83 | return False |
|
85 | return False | |
84 |
|
86 | |||
|
87 | # censored files compare against the empty file | |||
|
88 | if self._iscensored(node): | |||
|
89 | return text != '' | |||
|
90 | ||||
85 | # renaming a file produces a different hash, even if the data |
|
91 | # renaming a file produces a different hash, even if the data | |
86 | # remains unchanged. Check if it's the case (slow): |
|
92 | # remains unchanged. Check if it's the case (slow): | |
87 | if self.renamed(node): |
|
93 | if self.renamed(node): | |
@@ -100,3 +106,11 b' class filelog(revlog.revlog):' | |||||
100 |
|
106 | |||
101 | def _file(self, f): |
|
107 | def _file(self, f): | |
102 | return filelog(self.opener, f) |
|
108 | return filelog(self.opener, f) | |
|
109 | ||||
|
110 | def _iscensored(self, revornode): | |||
|
111 | """Check if a file revision is censored.""" | |||
|
112 | try: | |||
|
113 | self.revision(revornode) | |||
|
114 | return False | |||
|
115 | except error.CensoredNodeError: | |||
|
116 | return True |
General Comments 0
You need to be logged in to leave comments.
Login now