Download:
child 114:7314f0b864b8
parent 112:ac9565363b8d
113:c7bd4a3f0db5
Anton Shestakov <av6@dwimlabs.net>, Wed, 06 Jul 2016 14:04:30 +0800
adapters: add hgweb hosting adapter

1 файлов изменено, 22 вставок(+), 0 удалений(-) [+]
candolint/adapters.py file | annotate | diff | comparison | revisions
--- a/candolint/adapters.py Wed Jul 06 14:04:03 2016 +0800
+++ b/candolint/adapters.py Wed Jul 06 14:04:30 2016 +0800
@@ -36,3 +36,25 @@
'basename': basename(line['filename']),
'line': line['line_number']
})
+
+
+class HgwebAdapter(HostingAdapter):
+ def get_commit_url(self, change):
+ return '{url}/rev/{node}'.format(**{
+ 'url': self.project.url,
+ 'node': change.node
+ })
+
+ def get_branch_url(self, change):
+ return '{url}/log/{branch}'.format(**{
+ 'url': self.project.url,
+ 'branch': change.branch
+ })
+
+ def get_line_url(self, change, line):
+ return '{url}/file/{node}/{filename}#l{line}'.format(**{
+ 'url': self.project.url,
+ 'node': change.node,
+ 'filename': line['filename'],
+ 'line': line['line_number']
+ })