changeset 3310:0e370798eebf

context: add cmp for filectxs
author Matt Mackall <mpm@selenic.com>
date Tue, 10 Oct 2006 01:13:03 -0500
parents e8be5942335d
children 966632304dde
files mercurial/context.py
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/context.py	Tue Oct 10 00:54:00 2006 -0500
+++ b/mercurial/context.py	Tue Oct 10 01:13:03 2006 -0500
@@ -193,6 +193,8 @@
     def path(self): return self._path
     def size(self): return self._filelog.size(self._filerev)
 
+    def cmp(self, text): return self._filelog.cmp(self._filenode, text)
+
     def parents(self):
         p = self._path
         fl = self._filelog
@@ -467,3 +469,5 @@
         return []
 
     def size(self): return os.stat(self._repo.wjoin(self._path)).st_size
+
+    def cmp(self, text): return self._repo.wread(self._path) == text