summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-11-25 09:43:02 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-11-25 09:43:02 +0100
commit9e24a4a7a91cab92237e511b8cfd7664473b979a (patch)
treea60a56514cd19e11013588d885601ba9adc332a6
parenta8806260e704f44904b88f9902db5514a0a1a337 (diff)
parent2b20521a9418aaa0e8e8323689387f59ac3ea34e (diff)
Merge branch 'master' of /srv/git/gitnotipy
-rwxr-xr-xgitnoti.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/gitnoti.py b/gitnoti.py
index b40b0e9..3324c21 100755
--- a/gitnoti.py
+++ b/gitnoti.py
@@ -1,5 +1,21 @@
#!/usr/bin/env python
+# gitnotipy - An IRC bot which announces changes to a collection of git repositories
+# Copyright (C) 2009-2010 Jon Bergli Heier
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
import git, os, sys, time, pyinotify, netrc
from optparse import OptionParser
from twisted.words.protocols import irc
@@ -227,13 +243,14 @@ class Bot(irc.IRCClient):
def get_commits(self, repo, name):
try:
if '..' in name:
- frm, to = name.split('..')
- commits = list(repo.iter_commits('%s..%s' % (frm, to)))
+ commits = list(repo.iter_commits(name))
else:
commits = [repo.commit(name)]
except ValueError:
return []
- except git.errors.GitCommandError:
+ except git.exc.BadObject:
+ return []
+ except git.exc.GitCommandError:
return []
return commits