changeset 3002:dec78aee1d53 beta

small change to is_binary function logic so it always skips the unicode conversions to perform this simple check
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 13 Nov 2012 23:49:04 +0100
parents 37c7abd34d44
children adf8ee7b8f2a
files rhodecode/lib/vcs/nodes.py
diffstat 1 files changed, 9 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/rhodecode/lib/vcs/nodes.py	Tue Nov 13 22:26:06 2012 +0100
+++ b/rhodecode/lib/vcs/nodes.py	Tue Nov 13 23:49:04 2012 +0100
@@ -276,16 +276,20 @@
             mode = self._mode
         return mode
 
+    def _get_content(self):
+        if self.changeset:
+            content = self.changeset.get_file_content(self.path)
+        else:
+            content = self._content
+        return content
+
     @property
     def content(self):
         """
         Returns lazily content of the FileNode. If possible, would try to
         decode content from UTF-8.
         """
-        if self.changeset:
-            content = self.changeset.get_file_content(self.path)
-        else:
-            content = self._content
+        content = self._get_content()
 
         if bool(content and '\0' in content):
             return content
@@ -406,7 +410,7 @@
         """
         Returns True if file has binary content.
         """
-        _bin = '\0' in self.content
+        _bin = '\0' in self._get_content()
         return _bin
 
     @LazyProperty