Mercurial > public > mercurial-scm > hg-stable
diff mercurial/context.py @ 15738:e86dd8dfdea0
context: add isbinary function
author | Laurens Holst <laurens.hg@grauw.nl> |
---|---|
date | Wed, 21 Dec 2011 18:20:15 +0100 |
parents | dc3eefe0c80e |
children | 57241845a4bb |
line wrap: on
line diff
--- 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