Show More
@@ -353,6 +353,10 b' class filectx(object):' | |||
|
353 | 353 | return self._filelog.size(self._filerev) |
|
354 | 354 | |
|
355 | 355 | def cmp(self, text): |
|
356 | """compare text with stored file revision | |
|
357 | ||
|
358 | returns True if text is different than what is stored. | |
|
359 | """ | |
|
356 | 360 | return self._filelog.cmp(self._filenode, text) |
|
357 | 361 | |
|
358 | 362 | def renamed(self): |
@@ -932,6 +936,10 b' class workingfilectx(filectx):' | |||
|
932 | 936 | return (t, tz) |
|
933 | 937 | |
|
934 | 938 | def cmp(self, text): |
|
939 | """compare text with disk content | |
|
940 | ||
|
941 | returns True if text is different than what is on disk. | |
|
942 | """ | |
|
935 | 943 | return self._repo.wread(self._path) != text |
|
936 | 944 | |
|
937 | 945 | class memctx(object): |
@@ -56,7 +56,10 b' class filelog(revlog.revlog):' | |||
|
56 | 56 | return revlog.revlog.size(self, rev) |
|
57 | 57 | |
|
58 | 58 | def cmp(self, node, text): |
|
59 |
"""compare text with a given file revision |
|
|
59 | """compare text with a given file revision | |
|
60 | ||
|
61 | returns True if text is different than what is stored. | |
|
62 | """ | |
|
60 | 63 | |
|
61 | 64 | # for renames, we have to go the slow way |
|
62 | 65 | if text.startswith('\1\n') or self.renamed(node): |
@@ -943,7 +943,10 b' class revlog(object):' | |||
|
943 | 943 | raise LookupError(id, self.indexfile, _('no match found')) |
|
944 | 944 | |
|
945 | 945 | def cmp(self, node, text): |
|
946 |
"""compare text with a given file revision |
|
|
946 | """compare text with a given file revision | |
|
947 | ||
|
948 | returns True if text is different than what is stored. | |
|
949 | """ | |
|
947 | 950 | p1, p2 = self.parents(node) |
|
948 | 951 | return hash(text, p1, p2) != node |
|
949 | 952 |
General Comments 0
You need to be logged in to leave comments.
Login now