Patchwork [32,of,41] basefilectx: move isbinary from filectx

login
register
mail settings
Submitter Sean Farley
Date Aug. 12, 2013, 4:27 p.m.
Message ID <5d700e27ed06b22b10c1.1376324848@laptop.local>
Download mbox | patch
Permalink /patch/2160/
State Accepted
Commit a92302f48a56b942b82c9d92d52407d49591e497
Headers show

Comments

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

Patch

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.
         """