summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJon Bergli Heier <snakebite@jvnv.net>2010-11-25 09:42:46 +0100
committerJon Bergli Heier <snakebite@jvnv.net>2010-11-25 09:42:46 +0100
commita8806260e704f44904b88f9902db5514a0a1a337 (patch)
treeae0e7c7e1ec6c1f895687efa960190ed6c954415
parent97aa60f5db1af6a984cedf474e6683178eb0cf81 (diff)
commit.sha changed to commit.hexsha
-rwxr-xr-xgitnoti.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/gitnoti.py b/gitnoti.py
index 13bc6ae..b40b0e9 100755
--- a/gitnoti.py
+++ b/gitnoti.py
@@ -44,7 +44,7 @@ class NotifyRepo(object):
self.repo = git.Repo(path)
flags = pyinotify.EventsCodes.ALL_FLAGS
self.wdd = bot.wm.add_watch([os.path.join(path, 'refs/heads'), os.path.join(path, 'refs/tags')], flags['IN_MODIFY'] | flags['IN_CREATE'])
- self.heads = dict([(h.name, h.commit.sha) for h in self.repo.heads])
+ self.heads = dict([(h.name, h.commit.hexsha) for h in self.repo.heads])
self.tags = [t.name for t in self.repo.tags]
def repo_commit_msg(repo, branch, commits):
@@ -68,7 +68,7 @@ def repo_commit_msg(repo, branch, commits):
msg = '\002%s%s\002 pushed to \002%s\002 by \002%s\002 (%s) %s' % (
reponame,
('/'+branch) if branch else '',
- commit.sha[:7],
+ commit.hexsha[:7],
commit.committer.name if commit.author.name == commit.committer.name else '%s/%s' % (commit.committer.name, commit.author.name),
stat,
commit.summary
@@ -76,7 +76,7 @@ def repo_commit_msg(repo, branch, commits):
if options.url:
msg += ' | '
- url = options.url % {'repo': reponame, 'commit': commit.sha}
+ url = options.url % {'repo': reponame, 'commit': commit.hexsha}
if have_bitly:
short_url = None
try:
@@ -144,7 +144,7 @@ class ReposNotifyEvent(pyinotify.ProcessEvent):
return
for h in repo.heads:
last = l.heads[h.name] if h.name in l.heads else None
- if h.commit.sha != last:
+ if h.commit.hexsha != last:
if last: # Check against last commit
commits = list(repo.iter_commits('%s..%s' % (last, h.name)))
elif len(h.commit.parents): # Check against parent commit
@@ -157,11 +157,11 @@ class ReposNotifyEvent(pyinotify.ProcessEvent):
msg = repo_commit_msg(repo, h.name, commits)
self.bot.gitmsg(msg)
- l.heads[h.name] = h.commit.sha
+ l.heads[h.name] = h.commit.hexsha
for t in (t for t in repo.tags if t.name not in l.tags):
reponame = os.path.splitext(os.path.basename(repo.working_dir))[0]
- self.bot.gitmsg('New tag \002%s\002 for repo \002%s\002 points to \002%s\002' % (t.name, reponame, t.commit.sha[:7]))
+ self.bot.gitmsg('New tag \002%s\002 for repo \002%s\002 points to \002%s\002' % (t.name, reponame, t.commit.hexsha[:7]))
l.tags.append(t.name)
def process_IN_CREATE(self, event):