##// END OF EJS Templates
bumped version to 0.7.1 added atom and rss feeds. Moved https Fixud middleware before error middleware to proper generate debug page (static imports)
bumped version to 0.7.1 added atom and rss feeds. Moved https Fixud middleware before error middleware to proper generate debug page (static imports)

File last commit:

r195:7109d15c default
r207:8bdec094 rhodecode-0.0.0.7.1 default
Show More
hg_model.py
67 lines | 2.0 KiB | text/x-python | PythonLexer
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58 #!/usr/bin/env python
# encoding: utf-8
#
# Copyright (c) 2010 marcink. All rights reserved.
#
Added empty changeset to use in newly created repository, and used this inside a hg model in repos list
r136 from vcs.exceptions import RepositoryError
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58 '''
Created on Apr 9, 2010
@author: marcink
'''
import os
from pylons import tmpl_context as c, app_globals as g, session, request, config
from pylons.controllers.util import abort
cleared prints leftoovers, and changed current user fetching in login controller
r195 import sys
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58 try:
Marcin Kuzminski
Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
r74 from vcs.backends.hg import get_repositories, MercurialRepository
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58 except ImportError:
cleared prints leftoovers, and changed current user fetching in login controller
r195 sys.stderr.write('You have to import vcs module')
Change logic for more vcs based.
r95 raise Exception('Unable to import vcs')
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58
class HgModel(object):
"""
Mercurial Model
"""
def __init__(self):
"""
Constructor
"""
Marcin Kuzminski
Updated model with never vcs implementation using MercurialRepo class
r73 pass
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58
def get_repos(self):
Marcin Kuzminski
Updated model with never vcs implementation using MercurialRepo class
r73 for mercurial_repo in get_repositories(g.paths[0][0], g.paths[0][1], g.baseui):
if mercurial_repo._get_hidden():
#skip hidden web repository
continue
last_change = mercurial_repo.last_change
Added empty changeset to use in newly created repository, and used this inside a hg model in repos list
r136 try:
tip = mercurial_repo.get_changeset('tip')
except RepositoryError:
from pylons_app.lib.utils import EmptyChangeset
tip = EmptyChangeset()
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58 tmp_d = {}
Marcin Kuzminski
Updated model with never vcs implementation using MercurialRepo class
r73 tmp_d['name'] = mercurial_repo.name
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58 tmp_d['name_sort'] = tmp_d['name']
Marcin Kuzminski
Updated model with never vcs implementation using MercurialRepo class
r73 tmp_d['description'] = mercurial_repo.description
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58 tmp_d['description_sort'] = tmp_d['description']
Marcin Kuzminski
reimplemented summary page,...
r80 tmp_d['last_change'] = last_change
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58 tmp_d['last_change_sort'] = last_change[1] - last_change[0]
Added empty changeset to use in newly created repository, and used this inside a hg model in repos list
r136 tmp_d['tip'] = tip.raw_id
tmp_d['tip_sort'] = tip.revision
tmp_d['rev'] = tip.revision
Marcin Kuzminski
Updated model with never vcs implementation using MercurialRepo class
r73 tmp_d['contact'] = mercurial_repo.contact
tmp_d['contact_sort'] = tmp_d['contact']
added empty controllers for branches tags files graph, routing and test for them
r93 tmp_d['repo_archives'] = list(mercurial_repo._get_archives())
Marcin Kuzminski
Added hg model,implemented removal of repos, added HgModel for fetching repos(with generator)
r58
yield tmp_d
Marcin Kuzminski
Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
r74
def get_repo(self, repo_name):
Marcin Kuzminski
reimplemented summary page,...
r80 path = g.paths[0][1].replace('*', '')
repo = MercurialRepository(os.path.join(path, repo_name), baseui=g.baseui)
Marcin Kuzminski
Started summary page. Added filters to templates. used by n,self.f.filtername prefixed by n to disable other filters. Few other fixes found
r74 return repo