From 241e516d2ff93690fd1ae1ddd2049b289c5afeba Mon Sep 17 00:00:00 2001 From: Jon Bergli Heier Date: Tue, 28 Sep 2010 15:13:56 +0200 Subject: Added the tags command to list repo tags. --- gitnoti.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/gitnoti.py b/gitnoti.py index 09c5281..d2fc42a 100755 --- a/gitnoti.py +++ b/gitnoti.py @@ -297,6 +297,20 @@ class Bot(irc.IRCClient): reponame = os.path.splitext(os.path.basename(repo.working_dir))[0] self.msg(target, '\002%s\002 has branches %s' % (reponame, ', '.join(['\002%s\002' % h.name for h in repo.heads]))) + elif cmd == 'tags': + if not len(messagelist) == 3: + self.msg(target, 'Usage: %s tags REPO' % self.nickname) + return + + repo = self.get_repo(messagelist[2].lower(), target) + if not repo: + return + + reponame = os.path.splitext(os.path.basename(repo.working_dir))[0] + if not len(repo.tags): + self.msg(target, '\002%s\002 has no tags.' % reponame) + else: + self.msg(target, '\002%s\002 has tags %s' % (reponame, ', '.join(['\002%s\002' % t.name for t in repo.tags]))) class BotFactory(protocol.ReconnectingClientFactory): protocol = Bot -- cgit v1.2.3