summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-09-28 15:13:56 +0200
committerJon Bergli Heier <snakebite@jvnv.net>2010-09-28 15:13:56 +0200
commit241e516d2ff93690fd1ae1ddd2049b289c5afeba (patch)
treeb79195369079643ec61f3a3c870d1d09d56e5994
parent620333a07e91c4885dec469e5382d8d242a3a34e (diff)
Added the tags command to list repo tags.
-rwxr-xr-xgitnoti.py14
1 files changed, 14 insertions, 0 deletions
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