def is_following_repo(repo_name, user_id): from rhodecode.model.scm import ScmModel return ScmModel().is_following_repo(repo_name, user_id) flash = _Flash() #============================================================================== # SCM FILTERS available via h. #============================================================================== from rhodecode.lib.vcs.utils import author_name, author_email from rhodecode.lib.utils2 import credentials_filter, age as _age from rhodecode.model.db import User age = lambda x: _age(x) capitalize = lambda x: x.capitalize() email = author_email short_id = lambda x: x[:12] hide_credentials = lambda x: ''.join(credentials_filter(x)) def is_git(repository): if hasattr(repository, 'alias'): _type = repository.alias elif hasattr(repository, 'repo_type'): _type = repository.repo_type else: _type = repository return _type == 'git'
from pylons import session messages = session.pop(self.session_key, []) session.save() return [_Message(*m) for m in messages] flash = Flash() #============================================================================== # SCM FILTERS available via h. #============================================================================== from rhodecode.lib.vcs.utils import author_name, author_email from rhodecode.lib.utils2 import credentials_filter, age as _age from rhodecode.model.db import User, ChangesetStatus age = lambda x, y=False: _age(x, y) capitalize = lambda x: x.capitalize() email = author_email short_id = lambda x: x[:12] hide_credentials = lambda x: ''.join(credentials_filter(x)) def show_id(cs): """ Configurable function that shows ID by default it's r123:fffeeefffeee :param cs: changeset instance """ from rhodecode import CONFIG def_len = safe_int(CONFIG.get('show_sha_length', 12))
""" from pylons import session messages = session.pop(self.session_key, []) session.save() return [_Message(*m) for m in messages] flash = Flash() #============================================================================== # SCM FILTERS available via h. #============================================================================== from rhodecode.lib.vcs.utils import author_name, author_email from rhodecode.lib.utils2 import credentials_filter, age as _age from rhodecode.model.db import User, ChangesetStatus age = lambda x, y=False: _age(x, y) capitalize = lambda x: x.capitalize() email = author_email short_id = lambda x: x[:12] hide_credentials = lambda x: ''.join(credentials_filter(x)) def show_id(cs): """ Configurable function that shows ID by default it's r123:fffeeefffeee :param cs: changeset instance """ from rhodecode import CONFIG def_len = safe_int(CONFIG.get('show_sha_length', 12))
def is_following_repo(repo_name, user_id): from rhodecode.model.scm import ScmModel return ScmModel().is_following_repo(repo_name, user_id) flash = _Flash() #============================================================================== # SCM FILTERS available via h. #============================================================================== from rhodecode.lib.vcs.utils import author_name, author_email from rhodecode.lib.utils2 import credentials_filter, age as _age from rhodecode.model.db import User, ChangesetStatus age = lambda x: _age(x) capitalize = lambda x: x.capitalize() email = author_email short_id = lambda x: x[:12] hide_credentials = lambda x: ''.join(credentials_filter(x)) def fmt_date(date): if date: _fmt = _(u"%a, %d %b %Y %H:%M:%S").encode('utf8') return date.strftime(_fmt).decode('utf8') return "" def is_git(repository):