Download:
child 35:ec831f0ca300
parent 33:b0e492877263
34:0497bddba297 draft
Anton Shestakov <av6@dwimlabs.net>, Thu, 22 Nov 2018 17:47:07 +0800
plugin: make differential snarfing actually work

1 файлов изменено, 9 вставок(+), 6 удалений(-) [+]
plugin.py file | annotate | diff | comparison | revisions
--- a/plugin.py Thu Nov 22 17:17:23 2018 +0800
+++ b/plugin.py Thu Nov 22 17:47:07 2018 +0800
@@ -160,10 +160,7 @@
irc.reply('no match found')
glossary = wrap(glossary, ['text'])
- def differential(self, irc, msg, args, phabrev, gotURL=False):
- """<revision id>
-
- Returns URL, description and status of revisions on differential."""
+ def _differential(self, irc, phabrev, gotURL=False):
baseurl = self.registryValue('phaburl')
url = '{}/D{}'.format(baseurl.rstrip('/'), phabrev)
page = utils.web.getUrl(url).decode('utf-8')
@@ -182,6 +179,12 @@
item = 'Revision {} {}, {}'.format(url, status, desc)
irc.reply(item)
+
+ def differential(self, irc, msg, args, phabrev):
+ """<revision id>
+
+ Returns URL, description and status of revisions on differential."""
+ self._differential(irc, phabrev)
differential = wrap(differential, ['phabrev'])
def snarfDifferential(self, irc, msg, match):
@@ -191,7 +194,7 @@
return
phabrev = match.group('phabrev')
- self.differential(self, irc, msg, msg.args, phabrev)
+ self._differential(irc, phabrev)
@urlSnarfer
def snarfDifferentialURL(self, irc, msg, match):
@@ -205,6 +208,6 @@
return
phabrev = match.group('phabrev')
- self.differential(self, irc, msg, msg.args, phabrev, gotURL=True)
+ self._differential(irc, phabrev, gotURL=True)
Class = Mercurial