From: hyokeun Date: Tue, 10 Apr 2018 10:55:39 +0000 (+0900) Subject: Parsing commit log properly X-Git-Tag: accepted/tizen/devbase/services/20190930.043343~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F64%2F175464%2F1;p=services%2Fpython-snapdiff.git Parsing commit log properly Change-Id: If8ecee4e648f6e2b75d41d038200bae065f72866 --- diff --git a/snapdiff/__init__.py b/snapdiff/__init__.py index c64cbb7..785ca8c 100644 --- a/snapdiff/__init__.py +++ b/snapdiff/__init__.py @@ -98,15 +98,15 @@ def diff_to_json(old_url, new_url, **kwargs): #'--pretty="format:||||%H|||%aN<%aE>%n%s%n%b||||"'], stdout=f) f.close() f = io.open(log_filename, 'r', encoding='utf-8', errors='ignore') - contents = escape_html(f.read()) + contents = f.read() sp = contents.split("<-=^$>") data = [] for idx in range(1, len(sp), 2): l = sp[idx].split("<$^=->") - data.append({"commit_id": l[0], - "committer": l[1], - "commit_date": l[2], - "commit_log": {'html':escape_html_newline(l[3]), 'raw':l[3]}}) + data.append({"commit_id": escape_html(l[0]), + "committer": escape_html(l[1]), + "commit_date": escape_html(l[2]), + "commit_log": {'html':escape_html_newline(escape_html(l[3])), 'raw':escape_html(l[3])}}) f.close() return data