Changeset - c0a6a2e6bb2e
[Not reviewed]
beta
0 6 0
Marcin Kuzminski - 13 years ago 2012-10-23 18:21:56
marcin@python-works.com
Use lightweight revisions in journal by default
6 files changed with 26 insertions and 30 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/settings.py
Show inline comments
 
@@ -202,11 +202,6 @@ class SettingsController(BaseController)
 
                    form_result['rhodecode_lightweight_dashboard']
 
                Session().add(sett4)
 

	
 
                sett5 = RhodeCodeSetting.get_by_name_or_create('lightweight_journal')
 
                sett5.app_settings_value = \
 
                    form_result['rhodecode_lightweight_journal']
 
                Session().add(sett5)
 

	
 
                Session().commit()
 
                set_rhodecode_config(config)
 
                h.flash(_('Updated visualisation settings'),
rhodecode/lib/base.py
Show inline comments
 
@@ -248,7 +248,6 @@ class BaseController(WSGIController):
 
        c.visual.show_private_icon = str2bool(rc_config.get('rhodecode_show_private_icon'))
 
        c.visual.stylify_metatags = str2bool(rc_config.get('rhodecode_stylify_metatags'))
 
        c.visual.lightweight_dashboard = str2bool(rc_config.get('rhodecode_lightweight_dashboard'))
 
        c.visual.lightweight_journal = str2bool(rc_config.get('rhodecode_lightweight_dashboard'))
 

	
 
        c.repo_name = get_repo_slug(request)
 
        c.backends = BACKENDS.keys()
rhodecode/lib/helpers.py
Show inline comments
 
@@ -491,7 +491,7 @@ def bool2icon(value):
 
    return value
 

	
 

	
 
def action_parser(user_log, feed=False, parse_cs=True):
 
def action_parser(user_log, feed=False, parse_cs=False):
 
    """
 
    This helper will action_map the specified string action into translated
 
    fancy names with icons and links
 
@@ -500,9 +500,7 @@ def action_parser(user_log, feed=False, 
 
    :param feed: use output for feeds (no html and fancy icons)
 
    :param parse_cs: parse Changesets into VCS instances
 
    """
 
    from pylons import tmpl_context as c
 
    if c.visual.lightweight_journal:
 
        parse_cs = False
 

	
 
    action = user_log.action
 
    action_params = ' '
 

	
 
@@ -522,42 +520,42 @@ def action_parser(user_log, feed=False, 
 
        repo_name = user_log.repository.repo_name
 

	
 
        def lnk(rev, repo_name):
 

	
 
            if isinstance(rev, BaseChangeset) or isinstance(rev, AttributeDict):
 
                if rev.revision:
 
                    lbl = 'r%s:%s' % (rev.revision, rev.short_id)
 
                else:
 
                    lbl = '%s' % (rev.short_id)
 
                lbl = '%s' % (rev.short_id[:8])
 
                _url = url('changeset_home', repo_name=repo_name,
 
                           revision=rev.raw_id)
 
                title = tooltip(rev.message) if parse_cs else ''
 
                title = tooltip(rev.message)
 
            else:
 
                ## changeset cannot be found/striped/removed etc.
 
                lbl = ('%s' % rev)[:12]
 
                _url = '#'
 
                title = _('Changeset not found')
 

	
 
            return link_to(lbl, _url, title=title, 
 
                           class_='tooltip' if parse_cs else '',)
 
            if parse_cs:
 
                return link_to(lbl, _url, title=title, class_='tooltip')
 
            return link_to(lbl, _url, raw_id=rev.raw_id, class_='journal-cs')
 

	
 
        revs = []
 
        if len(filter(lambda v: v != '', revs_ids)) > 0:
 
            if parse_cs:
 
                repo = user_log.repository.scm_instance
 
            repo = None
 
            for rev in revs_ids[:revs_top_limit]:
 
                # we want parsed changesets, or new log store format is bad
 
                if parse_cs:
 
                    try:
 
                        rev = repo.get_changeset(rev)
 
                        revs.append(rev)
 
                        if repo is None:
 
                            repo = user_log.repository.scm_instance
 
                        _rev = repo.get_changeset(rev)
 
                        revs.append(_rev)
 
                    except ChangesetDoesNotExistError:
 
                        log.error('cannot find revision %s in this repo' % rev)
 
                        revs.append(rev)
 
                        continue
 
                else:
 
                    rev = AttributeDict({
 
                    _rev = AttributeDict({
 
                        'short_id': rev[:12],
 
                        'raw_id': rev,
 
                        'message': '',
 
                    })
 
                    revs.append(rev)
 
                    revs.append(_rev)
 
        cs_links = []
 
        cs_links.append(" " + ', '.join(
 
            [lnk(rev, repo_name) for rev in revs[:revs_limit]]
rhodecode/lib/hooks.py
Show inline comments
 
@@ -36,7 +36,7 @@ from rhodecode.lib.utils import action_l
 
from rhodecode.lib.vcs.backends.base import EmptyChangeset
 
from rhodecode.lib.compat import json
 
from rhodecode.lib.exceptions import HTTPLockedRC
 
from rhodecode.lib.utils2 import safe_str
 
from rhodecode.lib.utils2 import safe_str, datetime_to_time
 
from rhodecode.model.db import Repository, User
 

	
 

	
rhodecode/templates/admin/settings/settings.html
Show inline comments
 
@@ -131,10 +131,6 @@
 
                        ${h.checkbox('rhodecode_lightweight_dashboard','True')}
 
                        <label for="rhodecode_lightweight_dashboard">${_('Use lightweight dashboard')}</label>
 
                    </div>
 
                    <div class="checkbox">
 
                        ${h.checkbox('rhodecode_lightweight_journal','True')}
 
                        <label for="rhodecode_lightweight_journal">${_('Use lightweight journal')}</label>
 
                    </div>                    
 
                 </div>
 
             </div>
 

	
rhodecode/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -70,6 +70,8 @@
 
              <%include file="/compare/compare_cs.html" />
 

	
 
              ## FILES
 
              <div id="affected_files">
 
              % if c.files:
 
              <div style="font-size:1.1em;font-weight: bold;clear:both;padding-top:10px">${_('Files affected')}</div>
 
              <div class="cs_files">
 
                %for fid, change, f, stat in c.files:
 
@@ -79,6 +81,10 @@
 
                    </div>
 
                %endfor
 
              </div>
 
              %else:
 
                <div class="ui-btn" style="text-align: center;margin-top:5px">${_('Click to load diff details')}</div>
 
              %endif
 
              </div>
 
          </div>
 
      </div>
 
      ## REVIEWERS
 
@@ -131,10 +137,12 @@
 
    </script>
 

	
 
    ## diff block
 
    <div id="diff_block_container" style="clear:both;">
 
    <%namespace name="diff_block" file="/changeset/diff_block.html"/>
 
    %for fid, change, f, stat in c.files:
 
      ${diff_block.diff_block_simple([c.changes[fid]])}
 
    %endfor
 
    </div>
 

	
 
    ## template for inline comment form
 
    <%namespace name="comment" file="/changeset/changeset_file_comment.html"/>
0 comments (0 inline, 0 general)