Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

cleaner version checks for now.

  • Loading branch information...
commit 49d5e8e300ffd2368a45b74bc69dcb31c6e59891 1 parent 1a681b1
@mrjbq7 authored
Showing with 5 additions and 5 deletions.
  1. +5 −5 tracstats/web_ui.py
View
10 tracstats/web_ui.py
@@ -24,7 +24,7 @@
# In version 0.12, the time field in the database was changed
# from seconds to microseconds. This allows us to support both
# 0.11 and 0.12 with the same piece of code. It could be prettier.
-if any(trac.__version__.startswith(s) for s in ('0.12','0.13','1.')):
+if trac.__version__ > '0.12':
SECONDS = 'time / 1000000'
else:
SECONDS = 'time'
@@ -33,14 +33,14 @@
# repositories. Where the "rev" field was previously unique,
# the "(repos,rev)" fields are now unique. Doing it this way
# is a big performance boost.
-if any(trac.__version__.startswith(s) for s in ('0.12','0.13','1.')):
+if trac.__version__ > '0.12':
USING = "on r.repos = nc.repos and r.rev = nc.rev"
else:
USING = "using (rev)"
# In version 0.12, support for multiple repositories was
# added. We use the reponame to generate proper changeset links.
-if any(trac.__version__.startswith(s) for s in ('0.12','0.13','1.')):
+if trac.__version__ > '0.12':
REPOS = 'r.repos'
else:
REPOS = "'' as repos"
@@ -286,7 +286,7 @@ def _process(self, req, cursor, where, data):
# In version 0.12, support for multiple repositories was
# added. We use the reponame to generate proper changeset links.
- if any(trac.__version__.startswith(s) for s in ('0.12','0.13','1.')):
+ if trac.__version__ > '0.12':
cursor.execute("""
select id, value
from repository
@@ -435,7 +435,7 @@ def _process_code(self, req, cursor, where, data):
# In version 0.12, support for multiple repositories was
# added. We use the reponame to generate proper changeset links.
- if any(trac.__version__.startswith(s) for s in ('0.12','0.13','1.')):
+ if trac.__version__ > '0.12':
cursor.execute("""
select id, value
from repository

2 comments on commit 49d5e8e

@EagleErwin

I think the version check is wrong and should use "larger than or equal to" (if trac.__version__ >= '0.12':) instead of "larger than" (if trac.__version__ > '0.12':).

@mrjbq7
Owner

Fixed in 98aa1ed.

Good catch.

Please sign in to comment.
Something went wrong with that request. Please try again.