Download:
child 2:39f0d8a77f61
parent 0:5c1cbeda25de
1:eeb22e49b1fb
Brendan Cully <brendan@cs.ubc.ca>, Sat, 30 May 2009 20:44:14 -0700
Add revision lookup

4 файлов изменено, 32 вставок(+), 4 удалений(-) [+]
__init__.py file | annotate | diff | comparison | revisions
config.py file | annotate | diff | comparison | revisions
plugin.py file | annotate | diff | comparison | revisions
test.py file | annotate | diff | comparison | revisions
--- a/__init__.py Sat May 30 18:24:13 2009 -0700
+++ b/__init__.py Sat May 30 20:44:14 2009 -0700
@@ -1,5 +1,5 @@
###
-# Copyright (c) 2007, Brendan Cully
+# Copyright (c) 2007, 2009 Brendan Cully
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
--- a/config.py Sat May 30 18:24:13 2009 -0700
+++ b/config.py Sat May 30 20:44:14 2009 -0700
@@ -1,5 +1,5 @@
###
-# Copyright (c) 2007, Brendan Cully
+# Copyright (c) 2007, 2009 Brendan Cully
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
--- a/plugin.py Sat May 30 18:24:13 2009 -0700
+++ b/plugin.py Sat May 30 20:44:14 2009 -0700
@@ -1,5 +1,5 @@
###
-# Copyright (c) 2007, Brendan Cully
+# Copyright (c) 2007, 2009 Brendan Cully
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -67,6 +67,34 @@
irc.replies(fmt(out), joiner=' '.join)
hg = wrap(hg, ['text'])
+ def hglog(self, irc, msg, args, rev):
+ "gets the changelog message for the given revision"
+
+ # make configurable
+ repo = '/home/brendan/hg/mercurial/crew'
+ tmpl = '{rev}:{node|short}\n{date|age} ago\n{author}\n{files}\n{desc}'
+ cmd = "%s -R %s log -v --limit 1 --template '%s' -r %s" \
+ % (self.path, repo, tmpl, rev)
+ fd = os.popen(cmd)
+ out = fd.read()
+ fd.close()
+
+ if not out:
+ irc.reply('No result found.')
+ return
+
+ lines = [x for x in out.strip().splitlines() if x]
+ rev, date, user, files = lines[:4]
+ lines = lines[4:]
+ rev = ircutils.bold(rev)
+ user = ircutils.mircColor(user, fg='green')
+ date = ircutils.mircColor(date, fg='black')
+
+ lines = ['%s %s %s: %s' % (rev, user, date, files)] + lines
+ irc.replies(lines)
+
+ hglog = wrap(hglog, ['text'])
+
Class = Mercurial
--- a/test.py Sat May 30 18:24:13 2009 -0700
+++ b/test.py Sat May 30 20:44:14 2009 -0700
@@ -1,5 +1,5 @@
###
-# Copyright (c) 2007, Brendan Cully
+# Copyright (c) 2007, 2009 Brendan Cully
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without