# HG changeset patch # User Marcin Kuzminski # Date 1285703632 0 # Node ID b50e79b4257ac4bafa02aff22cd8f64971fad711 # Parent fdb78a140ae458cd27c72ee55d823ac556cc0668 fixes to pidlock, to not raise unneded execptions few fixes in templating for empty repository to not show some labels, fixed tag/branch switcher diff -r fdb78a140ae4 -r b50e79b4257a pylons_app/lib/celerylib/tasks.py --- a/pylons_app/lib/celerylib/tasks.py Tue Sep 28 02:31:10 2010 +0200 +++ b/pylons_app/lib/celerylib/tasks.py Tue Sep 28 19:53:52 2010 +0000 @@ -85,7 +85,7 @@ repo = MercurialRepository(repos_path + repo_name) skip_date_limit = True - parse_limit = 350 #limit for single task changeset parsing + parse_limit = 350 #limit for single task changeset parsing optimal for last_rev = 0 last_cs = None timegetter = itemgetter('time') @@ -98,9 +98,12 @@ .filter(Statistics.repository == dbrepo).scalar() if cur_stats: last_rev = cur_stats.stat_on_revision + if not repo.revisions: + return True if last_rev == repo.revisions[-1] and len(repo.revisions) > 1: - #pass silently without any work + #pass silently without any work if we're not on first revision or current + #state of parsing revision(from db marker) is the last revision return True if cur_stats: diff -r fdb78a140ae4 -r b50e79b4257a pylons_app/lib/pidlock.py --- a/pylons_app/lib/pidlock.py Tue Sep 28 02:31:10 2010 +0200 +++ b/pylons_app/lib/pidlock.py Tue Sep 28 19:53:52 2010 +0000 @@ -74,7 +74,8 @@ print "Lock File is there but the program is not running" print "Removing lock file for the: %s" % running_pid self.release() - raise + else: + raise else: print "You already have an instance of the program running" print "It is running as process %s" % running_pid diff -r fdb78a140ae4 -r b50e79b4257a pylons_app/templates/base/base.html --- a/pylons_app/templates/base/base.html Tue Sep 28 02:31:10 2010 +0200 +++ b/pylons_app/templates/base/base.html Tue Sep 28 19:53:52 2010 +0000 @@ -143,17 +143,25 @@
  • ${h.link_to(_('branches'),h.url('branches_home',repo_name=c.repo_name),class_='branches childs')}
  • ${h.link_to(_('tags'),h.url('tags_home',repo_name=c.repo_name),class_='tags childs')}
  • diff -r fdb78a140ae4 -r b50e79b4257a pylons_app/templates/index.html --- a/pylons_app/templates/index.html Tue Sep 28 02:31:10 2010 +0200 +++ b/pylons_app/templates/index.html Tue Sep 28 19:53:52 2010 +0000 @@ -64,10 +64,16 @@ h.url('summary_home',repo_name=repo['name']))} ${h.truncate(repo['description'],60)} ${h.age(repo['last_change'])} - ${h.link_to_if(repo['rev']>=0,'r%s:%s' % (repo['rev'],repo['tip']), + + %if repo['rev']>=0: + ${h.link_to('r%s:%s' % (repo['rev'],repo['tip']), h.url('changeset_home',repo_name=repo['name'],revision=repo['tip']), class_="tooltip", - tooltip_title=h.tooltip(repo['last_msg']))} + tooltip_title=h.tooltip(repo['last_msg']))} + %else: + ${_('No changesets yet')} + %endif + ${h.person(repo['contact'])} diff -r fdb78a140ae4 -r b50e79b4257a pylons_app/templates/shortlog/shortlog_data.html --- a/pylons_app/templates/shortlog/shortlog_data.html Tue Sep 28 02:31:10 2010 +0200 +++ b/pylons_app/templates/shortlog/shortlog_data.html Tue Sep 28 19:53:52 2010 +0000 @@ -38,7 +38,7 @@ | ${h.link_to(_('files'),h.url('files_home',repo_name=c.repo_name,revision=cs.raw_id))} - + %endfor @@ -59,5 +59,5 @@ YAHOO.util.Dom.setStyle(data_div,'opacity','1');}},null); return false;""")} %else: - ${_('There are no commits yet')} + ${_('There are no changes yet')} %endif diff -r fdb78a140ae4 -r b50e79b4257a pylons_app/templates/summary/summary.html --- a/pylons_app/templates/summary/summary.html Tue Sep 28 02:31:10 2010 +0200 +++ b/pylons_app/templates/summary/summary.html Tue Sep 28 19:53:52 2010 +0000 @@ -136,7 +136,7 @@ if(no_data){ var tr = document.createElement('tr'); var td1 = document.createElement('td'); - td1.innerHTML = "${_('No data loaded yet...')}"; + td1.innerHTML = "${_('No data loaded yet')}"; tr.appendChild(td1); tbl.appendChild(tr); } @@ -538,7 +538,9 @@
    <%include file='../shortlog/shortlog_data.html'/> - ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))} + %if c.repo_changesets: + ${h.link_to(_('show more'),h.url('changelog_home',repo_name=c.repo_name))} + %endif
    @@ -547,7 +549,9 @@
    <%include file='../tags/tags_data.html'/> - ${h.link_to(_('show more'),h.url('tags_home',repo_name=c.repo_name))} + %if c.repo_changesets: + ${h.link_to(_('show more'),h.url('tags_home',repo_name=c.repo_name))} + %endif
    @@ -556,7 +560,9 @@
    <%include file='../branches/branches_data.html'/> - ${h.link_to(_('show more'),h.url('branches_home',repo_name=c.repo_name))} + %if c.repo_changesets: + ${h.link_to(_('show more'),h.url('branches_home',repo_name=c.repo_name))} + %endif