Mercurial > public > src > rhodecode
comparison pylons_app/controllers/files.py @ 152:0c00fbaff55a
Fixed differ to properly extract filenames, and dates from diff file. and swaped order of columns with lines nr in diff html
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Sat, 15 May 2010 19:53:23 +0200 |
parents | b3c93efd1c97 |
children | f905f45c457e |
comparison
equal
deleted
inserted
replaced
151:988477a05db6 | 152:0c00fbaff55a |
---|---|
81 c.no_changes = diff1 == diff2 | 81 c.no_changes = diff1 == diff2 |
82 c.f_path = f_path | 82 c.f_path = f_path |
83 c.repo = hg_model.get_repo(c.repo_name) | 83 c.repo = hg_model.get_repo(c.repo_name) |
84 c.changeset_1 = c.repo.get_changeset(diff1) | 84 c.changeset_1 = c.repo.get_changeset(diff1) |
85 c.changeset_2 = c.repo.get_changeset(diff2) | 85 c.changeset_2 = c.repo.get_changeset(diff2) |
86 | 86 f1 = c.changeset_1.get_node(f_path) |
87 c.file_1 = c.changeset_1.get_file_content(f_path) | 87 f2 = c.changeset_2.get_node(f_path) |
88 c.file_2 = c.changeset_2.get_file_content(f_path) | 88 |
89 c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1._short) | 89 c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1._short) |
90 c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2._short) | 90 c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2._short) |
91 | 91 |
92 d2 = unified_diff(c.file_1.splitlines(1), c.file_2.splitlines(1)) | 92 f_udiff = unified_diff(f1.content.splitlines(True), |
93 c.diff_files = render_udiff(udiff=d2) | 93 f2.content.splitlines(True), |
94 f1.name, | |
95 f2.name) | |
94 | 96 |
97 c.diff_files = render_udiff(udiff=f_udiff, differ='difflib') | |
98 print c.diff_files | |
95 if len(c.diff_files) < 1: | 99 if len(c.diff_files) < 1: |
96 c.no_changes = True | 100 c.no_changes = True |
97 return render('files/file_diff.html') | 101 return render('files/file_diff.html') |
98 | 102 |
99 def _get_history(self, repo, node, f_path): | 103 def _get_history(self, repo, node, f_path): |