Parsing commit log properly 64/175464/1
authorhyokeun <hyokeun.jeon@samsung.com>
Tue, 10 Apr 2018 10:55:39 +0000 (19:55 +0900)
committerhyokeun <hyokeun.jeon@samsung.com>
Tue, 10 Apr 2018 10:55:50 +0000 (19:55 +0900)
Change-Id: If8ecee4e648f6e2b75d41d038200bae065f72866

snapdiff/__init__.py

index c64cbb7..785ca8c 100644 (file)
@@ -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