Mercurial > public > src > rhodecode
comparison pylons_app/controllers/files.py @ 130:ffddbd80649e
Added differ lib from mercurial.
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Tue, 04 May 2010 13:45:17 +0200 |
parents | 42d46deb124d |
children | 49c7e191c2cd |
comparison
equal
deleted
inserted
replaced
129:42d46deb124d | 130:ffddbd80649e |
---|---|
39 c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1._short) | 39 c.diff1 = 'r%s:%s' % (c.changeset_1.revision, c.changeset_1._short) |
40 c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2._short) | 40 c.diff2 = 'r%s:%s' % (c.changeset_2.revision, c.changeset_2._short) |
41 from difflib import unified_diff | 41 from difflib import unified_diff |
42 d = unified_diff(c.file_1.splitlines(1), c.file_2.splitlines(1)) | 42 d = unified_diff(c.file_1.splitlines(1), c.file_2.splitlines(1)) |
43 c.diff = ''.join(d) | 43 c.diff = ''.join(d) |
44 | |
45 from pylons_app.lib.differ import render_udiff | |
46 d2 = unified_diff(c.file_1.splitlines(1), c.file_2.splitlines(1)) | |
47 c.diff_2 = render_udiff(udiff=d2) | |
48 | |
44 return render('files/file_diff.html') | 49 return render('files/file_diff.html') |
45 | 50 |
46 def _get_history(self, repo, node, f_path): | 51 def _get_history(self, repo, node, f_path): |
47 from vcs.nodes import NodeKind | 52 from vcs.nodes import NodeKind |
48 if not node.kind is NodeKind.FILE: | 53 if not node.kind is NodeKind.FILE: |