Download:
child 39:ddc609bd0303
parent 37:b4e3fa814a17
38:ec32ce289f91 draft
Anton Shestakov <av6@dwimlabs.net>, Sun, 16 Dec 2018 11:17:34 +0800
plugin: highlight differential replies in color, similar to bz

2 файлов изменено, 7 вставок(+), 5 удалений(-) [+]
plugin.py file | annotate | diff | comparison | revisions
test.py file | annotate | diff | comparison | revisions
--- a/plugin.py Sun Dec 16 11:15:33 2018 +0800
+++ b/plugin.py Sun Dec 16 11:17:34 2018 +0800
@@ -178,7 +178,7 @@
url = 'D{}'.format(phabrev)
item = 'Revision {} {}, {}'.format(url, status, desc)
- irc.reply(item)
+ irc.reply(ircutils.mircColor(item, fg='blue'))
def differential(self, irc, msg, args, phabrev):
"""<revision id>
--- a/test.py Sun Dec 16 11:15:33 2018 +0800
+++ b/test.py Sun Dec 16 11:17:34 2018 +0800
@@ -51,14 +51,16 @@
self.assertHelp('main')
def testDifferential(self):
- expected = (
+ expected = ircutils.mircColor(
'Revision https://phab.mercurial-scm.org/D3850'
- ' Closed, stringutil: update list of re-special characters to include &~'
+ ' Closed, stringutil: update list of re-special characters to include &~',
+ fg='blue'
)
self.assertResponse('differential 3850', expected)
- expected = (
+ expected = ircutils.mircColor(
'Revision https://phab.mercurial-scm.org/D5194'
- ' Abandoned, wireprotov2: add an extension to cache wireproto v2 responses in S3'
+ ' Abandoned, wireprotov2: add an extension to cache wireproto v2 responses in S3',
+ fg='blue'
)
self.assertSnarfResponse('snarf me D5194!', expected)
self.assertHelp('differential')