From f8a2d9b469cf8cdaaac111aa855a439e7926a6d7 Mon Sep 17 00:00:00 2001 From: Faik Uygur Date: Thu, 14 Feb 2008 13:43:31 +0000 Subject: [PATCH] * reverse history as in svn log or git log --- pisi/db/historydb.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pisi/db/historydb.py b/pisi/db/historydb.py index 87d72701..357e38c8 100644 --- a/pisi/db/historydb.py +++ b/pisi/db/historydb.py @@ -29,6 +29,7 @@ class HistoryDB(lazydb.LazyDB): def __generate_history(self): logs = os.listdir(ctx.config.history_dir()) logs.sort() + logs.reverse() return logs def create_history(self, operation): @@ -46,9 +47,7 @@ class HistoryDB(lazydb.LazyDB): self.history.update() def get_last(self, count=0): - if not count or count > len(self.__logs): - count = len(self.__logs) - - for log in self.__logs[-count:]: + count = count or len(self.__logs) + for log in self.__logs[:count]: hist = pisi.history.History(os.path.join(ctx.config.history_dir(), log)) yield hist.operation