Changeset - fc08484c5bf3
[Not reviewed]
beta
0 6 0
Marcin Kuzminski - 13 years ago 2013-02-03 23:33:41
marcin@python-works.com
whitespace cleanup
6 files changed with 6 insertions and 9 deletions:
0 comments (0 inline, 0 general)
rhodecode/controllers/admin/repos.py
Show inline comments
 
@@ -23,49 +23,49 @@
 
# You should have received a copy of the GNU General Public License
 
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 

	
 
import logging
 
import traceback
 
import formencode
 
from formencode import htmlfill
 

	
 
from webob.exc import HTTPInternalServerError
 
from pylons import request, session, tmpl_context as c, url
 
from pylons.controllers.util import redirect
 
from pylons.i18n.translation import _
 
from sqlalchemy.exc import IntegrityError
 

	
 
import rhodecode
 
from rhodecode.lib import helpers as h
 
from rhodecode.lib.auth import LoginRequired, HasPermissionAllDecorator, \
 
    HasPermissionAnyDecorator, HasRepoPermissionAllDecorator
 
from rhodecode.lib.base import BaseRepoController, render
 
from rhodecode.lib.utils import invalidate_cache, action_logger, repo_name_slug
 
from rhodecode.lib.helpers import get_token
 
from rhodecode.model.meta import Session
 
from rhodecode.model.db import User, Repository, UserFollowing, RepoGroup,\
 
    RhodeCodeSetting, RepositoryField
 
from rhodecode.model.forms import RepoForm, RepoFieldForm 
 
from rhodecode.model.forms import RepoForm, RepoFieldForm
 
from rhodecode.model.scm import ScmModel, GroupList
 
from rhodecode.model.repo import RepoModel
 
from rhodecode.lib.compat import json
 
from sqlalchemy.sql.expression import func
 

	
 
log = logging.getLogger(__name__)
 

	
 

	
 
class ReposController(BaseRepoController):
 
    """
 
    REST Controller styled on the Atom Publishing Protocol"""
 
    # To properly map this controller, ensure your config/routing.py
 
    # file has a resource setup:
 
    #     map.resource('repo', 'repos')
 

	
 
    @LoginRequired()
 
    @HasPermissionAnyDecorator('hg.admin', 'hg.create.repository')
 
    def __before__(self):
 
        c.admin_user = session.get('admin_user')
 
        c.admin_username = session.get('admin_username')
 
        super(ReposController, self).__before__()
 

	
 
    def __load_defaults(self):
 
        acl_groups = GroupList(RepoGroup.query().all(),
 
@@ -507,25 +507,24 @@ class ReposController(BaseRepoController
 
            new_field.field_desc = form_result['new_field_desc']
 
            new_field.field_label = form_result['new_field_label']
 
            Session().add(new_field)
 
            Session().commit()
 

	
 
        except Exception, e:
 
            log.error(traceback.format_exc())
 
            msg = _('An error occurred during creation of field')
 
            if isinstance(e, formencode.Invalid):
 
                msg += ". " + e.msg
 
            h.flash(msg, category='error')
 
        return redirect(url('edit_repo', repo_name=repo_name))
 

	
 
    @HasPermissionAllDecorator('hg.admin')
 
    def delete_repo_field(self, repo_name, field_id):
 
        field = RepositoryField.get_or_404(field_id)
 
        try:
 
            Session().delete(field)
 
            Session().commit()
 
        except Exception, e:
 
            log.error(traceback.format_exc())
 
            msg = _('An error occurred during removal of field')
 
            h.flash(msg, category='error')
 
        return redirect(url('edit_repo', repo_name=repo_name))
 
    
rhodecode/model/pull_request.py
Show inline comments
 
@@ -180,49 +180,49 @@ class PullRequestModel(BaseModel):
 
                    'tag': 'tag',
 
                    'rev': 'id',
 
                }
 
            org_rev_spec = "%s('%s')" % (_revset_predicates[org_ref[0]],
 
                                         safe_str(org_ref[1]))
 
            org_rev = scmutil.revsingle(org_repo._repo,
 
                                         org_rev_spec)
 
            other_rev_spec = "%s('%s')" % (_revset_predicates[other_ref[0]],
 
                                           safe_str(other_ref[1]))
 
            other_rev = scmutil.revsingle(other_repo._repo, other_rev_spec)
 

	
 
            #case two independent repos
 
            if org_repo != other_repo:
 
                hgrepo = unionrepo.unionrepository(org_repo.baseui,
 
                                                   org_repo.path,
 
                                                   other_repo.path)
 
                revs = ["ancestors(id('%s')) and not ancestors(id('%s'))" %
 
                        (org_rev, other_rev)]
 

	
 
            #no remote compare do it on the same repository
 
            else:
 
                hgrepo = org_repo._repo
 
                revs = ["ancestors(id('%s')) and not ancestors(id('%s'))" %
 
                        (other_rev, org_rev)]
 
    
 

	
 
            out = scmutil.revrange(hgrepo, revs)
 
            for cs in (out):
 
                changesets.append(org_repo.get_changeset(cs))
 

	
 
        elif alias == 'git':
 
            assert org_repo == other_repo, (org_repo, other_repo) # no git support for different repos
 
            so, se = org_repo.run_git_command(
 
                'log --reverse --pretty="format: %%H" -s -p %s..%s' % (org_ref[1],
 
                                                                       other_ref[1])
 
            )
 
            ids = re.findall(r'[0-9a-fA-F]{40}', so)
 
            for cs in (ids):
 
                changesets.append(org_repo.get_changeset(cs))
 

	
 
        return changesets
 

	
 
    def get_compare_data(self, org_repo, org_ref, other_repo, other_ref):
 
        """
 
        Returns incoming changesets for mercurial repositories
 

	
 
        :param org_repo:
 
        :type org_repo:
 
        :param org_ref:
 
        :type org_ref:
rhodecode/templates/admin/repos/repo_edit.html
Show inline comments
 
@@ -323,46 +323,46 @@
 
            </td>
 
        </tr>
 
      %endfor
 
      </table>
 
    </div>
 

	
 
    ${h.form(url('create_repo_fields', repo_name=c.repo_info.repo_name),method='put')}
 
    <div class="form">
 
        <!-- fields -->
 
        <div class="fields">
 
             <div class="field">
 
                <div class="label">
 
                    <label for="new_field_key">${_('New field key')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.text('new_field_key', class_='small')}
 
                </div>
 
             </div>
 
             <div class="field">
 
                <div class="label">
 
                    <label for="new_field_label">${_('New field label')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.text('new_field_label', class_='small', placeholder=_('Enter short label'))}
 
                </div>             
 
                </div>
 
             </div>
 

	
 
             <div class="field">
 
                <div class="label">
 
                    <label for="new_field_desc">${_('New field description')}:</label>
 
                </div>
 
                <div class="input">
 
                    ${h.text('new_field_desc', class_='small', placeholder=_('Enter description of a field'))}
 
                </div>             
 
                </div>
 
             </div>
 

	
 
            <div class="buttons">
 
              ${h.submit('save',_('Add'),class_="ui-btn large")}
 
              ${h.reset('reset',_('Reset'),class_="ui-btn large")}
 
            </div>
 
        </div>
 
    </div>
 
    ${h.end_form()}
 
</div>
 
%endif
 
</%def>
rhodecode/templates/admin/settings/settings.html
Show inline comments
 
@@ -116,49 +116,49 @@
 
    </div>
 
    ${h.end_form()}
 

	
 
    <h3>${_('Visualisation settings')}</h3>
 
    ${h.form(url('admin_setting', setting_id='visual'),method='put')}
 
    <div class="form">
 
        <!-- fields -->
 

	
 
        <div class="fields">
 
             <div class="field">
 
                <div class="label label-checkbox">
 
                    <label>${_('General')}:</label>
 
                </div>
 
                <div class="checkboxes">
 
                    <div class="checkbox">
 
                        ${h.checkbox('rhodecode_lightweight_dashboard','True')}
 
                        <label for="rhodecode_lightweight_dashboard">${_('Use lightweight dashboard')}</label>
 
                    </div>
 
                </div>
 
                <div class="checkboxes">
 
                    <div class="checkbox">
 
                        ${h.checkbox('rhodecode_repository_fields','True')}
 
                        <label for="rhodecode_repository_fields">${_('Use repository extra fields')}</label>
 
                    </div>
 
                </div>                
 
                </div>
 
             </div>
 

	
 
             <div class="field">
 
                <div class="label label-checkbox">
 
                    <label>${_('Icons')}:</label>
 
                </div>
 
                <div class="checkboxes">
 
                    <div class="checkbox">
 
                        ${h.checkbox('rhodecode_show_public_icon','True')}
 
                        <label for="rhodecode_show_public_icon">${_('Show public repo icon on repositories')}</label>
 
                    </div>
 
                    <div class="checkbox">
 
                        ${h.checkbox('rhodecode_show_private_icon','True')}
 
                        <label for="rhodecode_show_private_icon">${_('Show private repo icon on repositories')}</label>
 
                    </div>
 
                 </div>
 
             </div>
 

	
 
             <div class="field">
 
                <div class="label label-checkbox">
 
                    <label>${_('Meta-Tagging')}:</label>
 
                </div>
 
                <div class="checkboxes">
 
                    <div class="checkbox">
rhodecode/templates/base/base.html
Show inline comments
 
@@ -339,29 +339,29 @@
 
    YUE.on('repo_switcher','mouseover',function(){
 
      var target = 'q_filter_rs';
 
      var qfilter_activate = function(){
 
          var nodes = YUQ('ul#repo_switcher_list li a.repo_name');
 
          var func = function(node){
 
              return node.parentNode;
 
          }
 
          q_filter(target,nodes,func);
 
      }
 

	
 
      var loaded = YUD.hasClass('repo_switcher','loaded');
 
      if(!loaded){
 
         YUD.addClass('repo_switcher','loaded');
 
         ypjax("${h.url('repo_switcher')}",'repo_switcher_list',
 
             function(o){qfilter_activate();YUD.get(target).focus()},
 
             function(o){YUD.removeClass('repo_switcher','loaded');}
 
             ,null);
 
      }else{
 
         YUD.get(target).focus();
 
      }
 
      return false;
 
     });
 

	
 
     YUE.on('header-dd', 'click',function(e){
 
         YUD.addClass('header-inner', 'hover');	 
 
         YUD.addClass('header-inner', 'hover');
 
     });
 

	
 
</script>
 
</%def>
rhodecode/templates/email_templates/pull_request_comment.html
Show inline comments
 
## -*- coding: utf-8 -*-
 
<%inherit file="main.html"/>
 

	
 
${_('User %s commented on pull request #%s for repository %s') % ('<b>%s</b>' % pr_comment_user, pr_id, pr_target_repo) |n}
 
<div>${_('View this comment here')}: ${pr_comment_url}</div>
 

	
 
<p>
 
${body}
 

	
 
%if status_change:
 
    <span>${_('New status')} -&gt; ${status_change}</span>
 
%endif
 
</p>
 

	
 

	
0 comments (0 inline, 0 general)