[PATCH 32 of 41] basefilectx: move isbinary from filectx

Sean Farley sean.michael.farley at gmail.com
Mon Aug 12 11:27:28 CDT 2013


# HG changeset patch
# User Sean Farley <sean.michael.farley at gmail.com>
# Date 1376279790 18000
#      Sun Aug 11 22:56:30 2013 -0500
# Node ID 5d700e27ed06b22b10c187ab6b9804381b51f0d2
# Parent  2eacec85b30a273d5f1bbe2f322feb28273b6af0
basefilectx: move isbinary from filectx

diff --git a/mercurial/context.py b/mercurial/context.py
--- a/mercurial/context.py
+++ b/mercurial/context.py
@@ -515,10 +515,16 @@
         return self._changectx
 
     def path(self):
         return self._path
 
+    def isbinary(self):
+        try:
+            return util.binary(self.data())
+        except IOError:
+            return False
+
 class filectx(basefilectx):
     """A filecontext object makes access to data related to a particular
        filerevision convenient."""
     def __init__(self, repo, path, changeid=None, fileid=None,
                  filelog=None, changectx=None):
@@ -575,16 +581,10 @@
     def data(self):
         return self._filelog.read(self._filenode)
     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
 
         returns True if different than fctx.
         """


More information about the Mercurial-devel mailing list