Changeset - 6ff98871247a
[Not reviewed]
beta
0 6 0
Mads Kiilerich - 13 years ago 2013-04-05 02:51:37
madski@unity3d.com
Grafted from: 50f09de21eb5
Minor changes
6 files changed with 9 insertions and 10 deletions:
0 comments (0 inline, 0 general)
rhodecode/model/db.py
Show inline comments
 
@@ -1157,25 +1157,25 @@ class Repository(Base, BaseModel):
 
    #==========================================================================
 
    # SCM CACHE INSTANCE
 
    #==========================================================================
 

	
 
    @property
 
    def invalidate(self):
 
        return CacheInvalidation.invalidate(self.repo_name)
 

	
 
    def set_invalidate(self):
 
        """
 
        Mark caches of this repo as invalid.
 
        """
 
        CacheInvalidation.set_invalidate(repo_name=self.repo_name)
 
        CacheInvalidation.set_invalidate(self.repo_name)
 

	
 
    def scm_instance_no_cache(self):
 
        return self.__get_instance()
 

	
 
    @property
 
    def scm_instance(self):
 
        import rhodecode
 
        full_cache = str2bool(rhodecode.CONFIG.get('vcs_full_cache'))
 
        if full_cache:
 
            return self.scm_instance_cached()
 
        return self.__get_instance()
 

	
rhodecode/model/scm.py
Show inline comments
 
@@ -96,26 +96,25 @@ class CachedRepoList(object):
 
    def __repr__(self):
 
        return '<%s (%s)>' % (self.__class__.__name__, self.__len__())
 

	
 
    def __iter__(self):
 
        # pre-propagated cache_map to save executing select statements
 
        # for each repo
 
        cache_map = CacheInvalidation.get_cache_map()
 

	
 
        for dbr in self.db_repo_list:
 
            scmr = dbr.scm_instance_cached(cache_map)
 
            # check permission at this level
 
            if not HasRepoPermissionAny(
 
                *self.perm_set
 
            )(dbr.repo_name, 'get repo check'):
 
                *self.perm_set)(dbr.repo_name, 'get repo check'):
 
                continue
 

	
 
            try:
 
                last_change = scmr.last_change
 
                tip = h.get_changeset_safe(scmr, 'tip')
 
            except Exception:
 
                log.error(
 
                    '%s this repository is present in database but it '
 
                    'cannot be created as an scm instance, org_exc:%s'
 
                    % (dbr.repo_name, traceback.format_exc())
 
                )
 
                continue
 
@@ -142,26 +141,25 @@ class CachedRepoList(object):
 
            yield tmp_d
 

	
 

	
 
class SimpleCachedRepoList(CachedRepoList):
 
    """
 
    Lighter version of CachedRepoList without the scm initialisation
 
    """
 

	
 
    def __iter__(self):
 
        for dbr in self.db_repo_list:
 
            # check permission at this level
 
            if not HasRepoPermissionAny(
 
                *self.perm_set
 
            )(dbr.repo_name, 'get repo check'):
 
                *self.perm_set)(dbr.repo_name, 'get repo check'):
 
                continue
 

	
 
            tmp_d = {}
 
            tmp_d['name'] = dbr.repo_name
 
            tmp_d['name_sort'] = tmp_d['name'].lower()
 
            tmp_d['raw_name'] = tmp_d['name'].lower()
 
            tmp_d['description'] = dbr.description
 
            tmp_d['description_sort'] = tmp_d['description'].lower()
 
            tmp_d['dbrepo'] = dbr.get_dict()
 
            tmp_d['dbrepo_fork'] = dbr.fork.get_dict() if dbr.fork else {}
 
            yield tmp_d
 

	
rhodecode/public/css/contextbar.css
Show inline comments
 
@@ -238,24 +238,25 @@ ul#context-actions {
 
}
 

	
 
#content #context-pages .icon {
 
    margin-right: 5px;
 
}
 

	
 
#header #header-inner #quick li,
 
#content #context-pages li {
 
    border-right: 1px solid rgba(0,0,0,0.1);
 
    border-left: 1px solid rgba(255,255,255,0.1);
 
    padding: 0;
 
}
 

	
 
#header #header-inner #quick li:last-child,
 
#content #context-pages li:last-child {
 
    border-right: none;
 
}
 

	
 
#header #header-inner #quick > li:first-child {
 
    border-left: none;
 
}
 

	
 
#header #header-inner #quick > li:first-child > a {
 
    border-radius: 4px 0 0 4px;
 
}
rhodecode/templates/admin/repos/repo_edit.html
Show inline comments
 
@@ -266,43 +266,43 @@ ${self.context_bar('options')}
 
     </div>
 
    </div>
 
    ${h.end_form()}
 

	
 
    <h3>${_('Locking')}</h3>
 
    ${h.form(url('repo_locking', repo_name=c.repo_info.repo_name),method='put')}
 
    <div class="form">
 
       <div class="fields">
 
          %if c.repo_info.locked[0]:
 
           ${h.submit('set_unlock' ,_('Unlock locked repo'),class_="ui-btn",onclick="return confirm('"+_('Confirm to unlock repository')+"');")}
 
           ${'Locked by %s on %s' % (h.person_by_id(c.repo_info.locked[0]),h.fmt_date(h.time_to_datetime(c.repo_info.locked[1])))}
 
          %else:
 
            ${h.submit('set_lock',_('lock repo'),class_="ui-btn",onclick="return confirm('"+_('Confirm to lock repository')+"');")}
 
            ${h.submit('set_lock',_('Lock repo'),class_="ui-btn",onclick="return confirm('"+_('Confirm to lock repository')+"');")}
 
            ${_('Repository is not locked')}
 
          %endif
 
       </div>
 
       <div class="field" style="border:none;color:#888">
 
       <ul>
 
            <li>${_('Force locking on repository. Works only when anonymous access is disabled')}
 
            </li>
 
       </ul>
 
       </div>
 
    </div>
 
    ${h.end_form()}
 

	
 
    <h3>${_('Set as fork of')}</h3>
 
    ${h.form(url('repo_as_fork', repo_name=c.repo_info.repo_name),method='put')}
 
    <div class="form">
 
       <div class="fields">
 
           ${h.select('id_fork_of','',c.repos_list,class_="medium")}
 
           ${h.submit('set_as_fork_%s' % c.repo_info.repo_name,_('set'),class_="ui-btn",)}
 
           ${h.submit('set_as_fork_%s' % c.repo_info.repo_name,_('Set'),class_="ui-btn",)}
 
       </div>
 
           <div class="field" style="border:none;color:#888">
 
           <ul>
 
                <li>${_('''Manually set this repository as a fork of another from the list''')}</li>
 
           </ul>
 
           </div>
 
    </div>
 
    ${h.end_form()}
 

	
 
    <h3>${_('Delete')}</h3>
 
    ${h.form(url('repo', repo_name=c.repo_info.repo_name),method='delete')}
 
    <div class="form">
rhodecode/templates/pullrequests/pullrequest_show.html
Show inline comments
 
@@ -69,25 +69,25 @@ ${self.context_bar('showpullrequest')}
 
             ##%if h.is_hg(c.pull_request.org_repo):
 
             ##  <img class="icon" title="${_('Mercurial repository')}" alt="${_('Mercurial repository')}" src="${h.url('/images/icons/hgicon.png')}"/>
 
             ##%elif h.is_git(c.pull_request.org_repo):
 
             ##  <img class="icon" title="${_('Git repository')}" alt="${_('Git repository')}" src="${h.url('/images/icons/giticon.png')}"/>
 
             ##%endif
 
              <span class="spantag">${c.pull_request.org_ref_parts[0]}: ${c.pull_request.org_ref_parts[1]}</span>
 
              <span><a href="${h.url('summary_home', repo_name=c.pull_request.org_repo.repo_name)}">${c.pull_request.org_repo.clone_url()}</a></span>
 
              </div>
 
          </div>
 
         </div>
 
         <div class="field">
 
          <div class="label-summary">
 
              <label>${_('Summary')}:</label>
 
              <label>${_('Description')}:</label>
 
          </div>
 
          <div class="input">
 
              <div style="white-space:pre-wrap">${h.literal(c.pull_request.description)}</div>
 
          </div>
 
         </div>
 
         <div class="field">
 
          <div class="label-summary">
 
              <label>${_('Created on')}:</label>
 
          </div>
 
          <div class="input">
 
              <div>${h.fmt_date(c.pull_request.created_on)}</div>
 
          </div>
rhodecode/templates/summary/summary.html
Show inline comments
 
@@ -139,41 +139,41 @@ ${self.context_bar('summary')}
 
             </div>
 

	
 
             <div class="field">
 
              <div class="label-summary">
 
                  <label>${_('Trending files')}:</label>
 
              </div>
 
              <div class="input ${summary(c.show_stats)}">
 
                %if c.show_stats:
 
                <div id="lang_stats"></div>
 
                %else:
 
                   ${_('Statistics are disabled for this repository')}
 
                   %if h.HasPermissionAll('hg.admin')('enable stats on from summary'):
 
                        ${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
 
                        ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
 
                   %endif
 
                %endif
 
              </div>
 
             </div>
 

	
 
             <div class="field">
 
              <div class="label-summary">
 
                  <label>${_('Download')}:</label>
 
              </div>
 
              <div class="input ${summary(c.show_stats)}">
 
                %if len(c.rhodecode_repo.revisions) == 0:
 
                  ${_('There are no downloads yet')}
 
                %elif not c.enable_downloads:
 
                  ${_('Downloads are disabled for this repository')}
 
                    %if h.HasPermissionAll('hg.admin')('enable downloads on from summary'):
 
                        ${h.link_to(_('enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
 
                        ${h.link_to(_('Enable'),h.url('edit_repo',repo_name=c.repo_name),class_="ui-btn")}
 
                    %endif
 
                %else:
 
                    ${h.select('download_options',c.rhodecode_repo.get_changeset().raw_id,c.download_options)}
 
                         <span id="${'zip_link'}">${h.link_to(_('Download as zip'), h.url('files_archive_home',repo_name=c.dbrepo.repo_name,fname='tip.zip'),class_="archive_icon ui-btn")}</span>
 
                    <span style="vertical-align: bottom">
 
                        <input id="archive_subrepos" type="checkbox" name="subrepos" />
 
                        <label for="archive_subrepos" class="tooltip" title="${h.tooltip(_('Check this to download archive with subrepos'))}" >${_('with subrepos')}</label>
 
                    </span>
 
                %endif
 
              </div>
 
             </div>
 
        </div>
0 comments (0 inline, 0 general)