[Reproducible-commits] [debbindiff] 05/19: Convert text comparator to pass file directly to diff

Jérémy Bobbio lunar at moszumanska.debian.org
Tue Mar 31 14:59:28 UTC 2015


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch pu/feed-diff
in repository debbindiff.

commit 32f704e4c385bfb2c86e29646656d25bb60495ca
Author: Jérémy Bobbio <lunar at debian.org>
Date:   Mon Mar 30 06:48:28 2015 +0200

    Convert text comparator to pass file directly to diff
---
 debbindiff/comparators/text.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/debbindiff/comparators/text.py b/debbindiff/comparators/text.py
index 6afc3a2..985deb4 100644
--- a/debbindiff/comparators/text.py
+++ b/debbindiff/comparators/text.py
@@ -26,12 +26,12 @@ def compare_text_files(path1, path2, encoding, source=None):
     if encoding is None:
         encoding = 'utf-8'
     try:
-        content1 = codecs.open(path1, 'r', encoding=encoding).read()
-        content2 = codecs.open(path2, 'r', encoding=encoding).read()
+        file1 = codecs.open(path1, 'r', encoding=encoding)
+        file2 = codecs.open(path2, 'r', encoding=encoding)
+        difference = Difference.from_file(file1, file2, path1, path2, source)
     except (LookupError, UnicodeDecodeError):
         # unknown or misdetected encoding
         return compare_binary_files(path1, path2, source)
-    difference = Difference.from_content(content1, content2, path1, path2, source)
     if not difference:
         return []
     return [difference]

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/debbindiff.git



More information about the Reproducible-commits mailing list