summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2011-02-03 21:32:19 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2011-02-03 21:32:19 +0100
commitab83f74f6162683f22da354532c7cf5353bf940f (patch)
tree4b6525fc89fae17c183c659c19f41c85576ce9f7
parent4af398f3c010e244ba7014dee3375b0e2a612930 (diff)
Sort some lists.
-rwxr-xr-xgitnoti.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/gitnoti.py b/gitnoti.py
index db39ce1..a8d5f05 100755
--- a/gitnoti.py
+++ b/gitnoti.py
@@ -267,11 +267,11 @@ class Bot(irc.IRCClient):
tags = self.get_tags(repo, name)
if len(branches) and len(tags):
raise GitnoitpyAmbiguousException('Ambiguous name: %s (\002branches\002 %s tags \002%s\002' % (
- name, ', '.join((x.name for x in branches)), ', '.join((x.name for x in tags))))
+ name, ', '.join(sorted([x.name for x in branches])), ', '.join(sorted([x.name for x in tags]))))
elif len(branches) > 1:
- raise GitnoitpyAmbiguousException('Ambiguous name: %s' % (', '.join((x.name for x in branches))))
+ raise GitnoitpyAmbiguousException('Ambiguous name: %s' % (', '.join(sorted([x.name for x in branches]))))
elif len(tags) > 1:
- raise GitnoitpyAmbiguousException('Ambiguous name: %s' % (', '.join((x.name for x in tags))))
+ raise GitnoitpyAmbiguousException('Ambiguous name: %s' % (', '.join(sorted([x.name for x in tags]))))
elif len(branches):
commits, branch = [branches[0].commit], branches[0].name
elif len(tags):
@@ -301,7 +301,7 @@ class Bot(irc.IRCClient):
if messagelist[0].startswith(self.nickname):
cmd = messagelist[1].lower()
if cmd == 'list':
- s = 'Repos: %s' % ', '.join([os.path.splitext(os.path.basename(x))[0] for x in repos.keys()])
+ s = 'Repos: %s' % ', '.join(sorted([os.path.splitext(os.path.basename(x))[0] for x in repos.keys()]))
self.msg(target, s)
elif cmd == 'show':
if len(messagelist) < 3:
@@ -337,7 +337,7 @@ class Bot(irc.IRCClient):
return
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])))
+ self.msg(target, '\002%s\002 has branches %s' % (reponame, ', '.join(sorted(['\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)
@@ -351,7 +351,7 @@ class Bot(irc.IRCClient):
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])))
+ self.msg(target, '\002%s\002 has tags %s' % (reponame, ', '.join(sorted(['\002%s\002' % t.name for t in repo.tags]))))
class BotFactory(protocol.ReconnectingClientFactory):
protocol = Bot