chiark / gitweb /
blame #last: Blame the right thing
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Wed, 29 May 2019 14:11:27 +0000 (15:11 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 30 May 2019 10:15:15 +0000 (11:15 +0100)
Previously this would search all the blame databases.  This is wrong,
it should search the one corresponding to the last fish.  Now that we
have last_cfg, and the db info is in the cfg, we can do that.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
commands.py

index a8499587f222c016b408000b72059b5e7314f431..a5745091241a1ac87c649d2a85cfc5b49c98ebdb 100755 (executable)
@@ -324,7 +324,11 @@ def blameq(bot,cmd,nick,conn,public,fish,cfgs):
        return
     cwhat=' '.join(clist[2:])
     if clist[1]=="#last":
-       ans=__getall(tdb,tdbk,fdb,fdbk,sdb,sdbk,fish.last)
+       if fish.last_cfg is None:
+           bot.automsg(public,nick,"Nothing")
+           return
+       xdb,xdbk = fish.last_cfg[7]
+       ans=__getcommits(xdb,xdbk,fish.last)
     elif clist[1]=="#trouts" or clist[1]=="#trout":
        ans=__getcommits(tdb,tdbk,cwhat)
     elif clist[1]=="#flirts" or clist[1]=="#flirt":