diff rhodecode/controllers/compare.py @ 3821:ce4b7023a492 beta

diff parser: redefined operations stats for changes - don't loose info about multiple operations like rename + chmod - new Binary flag when dealing with binary file operations - fixed diffs after mercurial 2.6 when GIT binary diffs were fixed - added more tests for multiple operations - refactored the way diffprocessor returns data. It's now easier to extract type of operation on binary files - diffprocessor doesn't append that information into the diff itself
author Marcin Kuzminski <marcin@python-works.com>
date Wed, 08 May 2013 01:19:18 +0200
parents 4324d6899e55
children 42bca6fa923b
line wrap: on
line diff
--- a/rhodecode/controllers/compare.py	Wed Apr 10 03:00:20 2013 +0200
+++ b/rhodecode/controllers/compare.py	Wed May 08 01:19:18 2013 +0200
@@ -258,9 +258,9 @@
         c.lines_deleted = 0
         for f in _parsed:
             st = f['stats']
-            if st[0] != 'b':
-                c.lines_added += st[0]
-                c.lines_deleted += st[1]
+            if not st['binary']:
+                c.lines_added += st['added']
+                c.lines_deleted += st['deleted']
             fid = h.FID('', f['filename'])
             c.files.append([fid, f['operation'], f['filename'], f['stats']])
             htmldiff = diff_processor.as_html(enable_comments=False, parsed_lines=[f])