diff -r 8edd9f2c7b57 -r e86dd8dfdea0 mercurial/context.py --- a/mercurial/context.py Tue Dec 27 21:12:09 2011 +0100 +++ b/mercurial/context.py Wed Dec 21 18:20:15 2011 +0100 @@ -372,6 +372,12 @@ def size(self): return self._filelog.size(self._filerev) + def isbinary(self): + try: + return util.binary(self.data()) + except IOError: + return False + def cmp(self, fctx): """compare with other file context