comparison pylons_app/lib/celerylib/tasks.py @ 556:b50e79b4257a

fixes to pidlock, to not raise unneded execptions few fixes in templating for empty repository to not show some labels, fixed tag/branch switcher
author Marcin Kuzminski <marcin@python-works.com>
date Tue, 28 Sep 2010 19:53:52 +0000
parents d5efb83590ef
children a08f610e545e
comparison
equal deleted inserted replaced
555:fdb78a140ae4 556:b50e79b4257a
83 commits_by_day_aggregate = {} 83 commits_by_day_aggregate = {}
84 repos_path = get_hg_ui_settings()['paths_root_path'].replace('*', '') 84 repos_path = get_hg_ui_settings()['paths_root_path'].replace('*', '')
85 repo = MercurialRepository(repos_path + repo_name) 85 repo = MercurialRepository(repos_path + repo_name)
86 86
87 skip_date_limit = True 87 skip_date_limit = True
88 parse_limit = 350 #limit for single task changeset parsing 88 parse_limit = 350 #limit for single task changeset parsing optimal for
89 last_rev = 0 89 last_rev = 0
90 last_cs = None 90 last_cs = None
91 timegetter = itemgetter('time') 91 timegetter = itemgetter('time')
92 92
93 sa = get_session() 93 sa = get_session()
96 .filter(Repository.repo_name == repo_name).scalar() 96 .filter(Repository.repo_name == repo_name).scalar()
97 cur_stats = sa.query(Statistics)\ 97 cur_stats = sa.query(Statistics)\
98 .filter(Statistics.repository == dbrepo).scalar() 98 .filter(Statistics.repository == dbrepo).scalar()
99 if cur_stats: 99 if cur_stats:
100 last_rev = cur_stats.stat_on_revision 100 last_rev = cur_stats.stat_on_revision
101 if not repo.revisions:
102 return True
101 103
102 if last_rev == repo.revisions[-1] and len(repo.revisions) > 1: 104 if last_rev == repo.revisions[-1] and len(repo.revisions) > 1:
103 #pass silently without any work 105 #pass silently without any work if we're not on first revision or current
106 #state of parsing revision(from db marker) is the last revision
104 return True 107 return True
105 108
106 if cur_stats: 109 if cur_stats:
107 commits_by_day_aggregate = OrderedDict( 110 commits_by_day_aggregate = OrderedDict(
108 json.loads( 111 json.loads(