##// END OF EJS Templates
small change to is_binary function logic so it always skips the unicode conversions to perform this simple check
marcink -
r3002:dec78aee beta
parent child Browse files
Show More
@@ -276,16 +276,20 b' class FileNode(Node):'
276 276 mode = self._mode
277 277 return mode
278 278
279 def _get_content(self):
280 if self.changeset:
281 content = self.changeset.get_file_content(self.path)
282 else:
283 content = self._content
284 return content
285
279 286 @property
280 287 def content(self):
281 288 """
282 289 Returns lazily content of the FileNode. If possible, would try to
283 290 decode content from UTF-8.
284 291 """
285 if self.changeset:
286 content = self.changeset.get_file_content(self.path)
287 else:
288 content = self._content
292 content = self._get_content()
289 293
290 294 if bool(content and '\0' in content):
291 295 return content
@@ -406,7 +410,7 b' class FileNode(Node):'
406 410 """
407 411 Returns True if file has binary content.
408 412 """
409 _bin = '\0' in self.content
413 _bin = '\0' in self._get_content()
410 414 return _bin
411 415
412 416 @LazyProperty
General Comments 0
You need to be logged in to leave comments. Login now