diff options
author | Marcin Kuzminski <marcin@python-works.com> | 2010-10-10 00:13:03 +0200 |
---|---|---|
committer | Marcin Kuzminski <marcin@python-works.com> | 2010-10-10 00:13:03 +0200 |
commit | 77e715c91891928ab72aed7ebe6994a13b87564f (patch) | |
tree | 4192085c1faecce482c5e39b1ddb55b39c1c2df6 /rhodecode | |
parent | 78e3b59a77367b895a2e0c7850a2cd1974001ce7 (diff) |
large initial commits fixup
little template fix
Diffstat (limited to 'rhodecode')
-rw-r--r-- | rhodecode/controllers/changeset.py | 15 | ||||
-rw-r--r-- | rhodecode/templates/changelog/changelog.html | 7 |
2 files changed, 16 insertions, 6 deletions
diff --git a/rhodecode/controllers/changeset.py b/rhodecode/controllers/changeset.py index 3afdc33e..7cff6b1e 100644 --- a/rhodecode/controllers/changeset.py +++ b/rhodecode/controllers/changeset.py @@ -16,6 +16,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. +from rhodecode.lib.utils import EmptyChangeset """ Created on April 25, 2010 changeset controller for pylons @@ -45,7 +46,7 @@ class ChangesetController(BaseController): def index(self, revision): hg_model = HgModel() - cut_off_limit = 1024 * 100 + cut_off_limit = 1024 * 250 def wrap_to_table(str): @@ -74,7 +75,7 @@ class ChangesetController(BaseController): c.sum_added = 0 for node in c.changeset.added: - filenode_old = FileNode(node.path, '') + filenode_old = FileNode(node.path, '', EmptyChangeset()) if filenode_old.is_binary or node.is_binary: diff = wrap_to_table(_('binary file')) else: @@ -82,6 +83,7 @@ class ChangesetController(BaseController): if c.sum_added < cut_off_limit: f_udiff = differ.get_udiff(filenode_old, node) diff = differ.DiffProcessor(f_udiff).as_html() + else: diff = wrap_to_table(_('Changeset is to big and was cut' ' off, see raw changeset instead')) @@ -98,19 +100,22 @@ class ChangesetController(BaseController): try: filenode_old = c.changeset_old.get_node(node.path) except ChangesetError: - filenode_old = FileNode(node.path, '') + filenode_old = FileNode(node.path, '', EmptyChangeset()) if filenode_old.is_binary or node.is_binary: diff = wrap_to_table(_('binary file')) else: - c.sum_removed += node.size + if c.sum_removed < cut_off_limit: f_udiff = differ.get_udiff(filenode_old, node) diff = differ.DiffProcessor(f_udiff).as_html() + if diff: + c.sum_removed += len(diff) else: diff = wrap_to_table(_('Changeset is to big and was cut' ' off, see raw changeset instead')) - + + cs1 = filenode_old.last_changeset.short_id cs2 = node.last_changeset.short_id c.changes.append(('changed', node, diff, cs1, cs2)) diff --git a/rhodecode/templates/changelog/changelog.html b/rhodecode/templates/changelog/changelog.html index 466cafeb..17e05310 100644 --- a/rhodecode/templates/changelog/changelog.html +++ b/rhodecode/templates/changelog/changelog.html @@ -66,12 +66,17 @@ <div class="merge"> ${_('merge')}<img alt="merge" src="/images/icons/arrow_join.png"/> </div> - %endif + %endif + %if cs.parents: %for p_cs in reversed(cs.parents): <div class="parent">${_('Parent')} ${p_cs.revision}: ${h.link_to(p_cs.short_id, h.url('changeset_home',repo_name=c.repo_name,revision=p_cs.short_id),title=p_cs.message)} </div> %endfor + %else: + <div class="parent">${_('No parents')}</div> + %endif + <span class="logtags"> <span class="branchtag" title="${'%s %s' % (_('branch'),cs.branch)}"> ${h.link_to(cs.branch,h.url('files_home',repo_name=c.repo_name,revision=cs.short_id))}</span> |