# HG changeset patch # User Marcin Kuzminski # Date 1352846944 -3600 # Node ID dec78aee1d533db78ab1d08aa40419ad2a0edff6 # Parent 37c7abd34d440156d29b27c34655192fb03e4024 small change to is_binary function logic so it always skips the unicode conversions to perform this simple check diff -r 37c7abd34d44 -r dec78aee1d53 rhodecode/lib/vcs/nodes.py --- 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