[entropy.db.sql] retrieveTreeUpdatesActions, listAllTreeUpdatesActions: order results by date

This commit is contained in:
Fabio Erculiani
2013-06-10 10:37:35 +02:00
parent 3dcbe49281
commit b8b958604f
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -2003,6 +2003,7 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore):
audience.
List all the available "treeupdates" (package names/slots changes
directives) actions.
Actions must be sorted by date (FLOAT).
@keyword no_ids_repos: if True, it will just return a tuple of 3-length
tuples containing ((command, branch, unix_time,), ...)
@@ -2018,6 +2019,7 @@ class EntropyRepositoryBase(TextInterface, EntropyRepositoryPluginStore):
audience.
Return all the available "treeupdates (package names/slots changes
directives) actions for provided repository.
Actions must be sorted by date (FLOAT).
@param repository: repository identifier
@type repository: string
+3 -2
View File
@@ -2581,11 +2581,12 @@ class EntropySQLRepository(EntropyRepositoryBase):
if no_ids_repos:
cur = self._cursor().execute("""
SELECT command, branch, date FROM treeupdatesactions
ORDER BY CAST(date AS FLOAT)
""")
else:
cur = self._cursor().execute("""
SELECT idupdate, repository, command, branch, date
FROM treeupdatesactions
FROM treeupdatesactions ORDER BY CAST(date AS FLOAT)
""")
return tuple(cur)
@@ -2597,7 +2598,7 @@ class EntropySQLRepository(EntropyRepositoryBase):
cur = self._cursor().execute("""
SELECT command FROM treeupdatesactions WHERE
repository = ? ORDER BY date""", params)
repository = ? ORDER BY CAST(date AS FLOAT)""", params)
return self._cur2tuple(cur)
def bumpTreeUpdatesActions(self, updates):