Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: hgreview.py

Issue 29845569: Noissue - Fix hgreview for Mercurial 4.7: cmdutil.command -> registrar.command (Closed) Base URL: https://hg.adblockplus.org/codingtools/
Patch Set: Created Aug. 2, 2018, 5:01 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import BaseHTTPServer 1 import BaseHTTPServer
2 import os 2 import os
3 import re 3 import re
4 import socket 4 import socket
5 import sys 5 import sys
6 import urllib 6 import urllib
7 7
8 from mercurial import cmdutil, error 8 from mercurial import cmdutil, error
9 9
10 SERVER = 'https://codereview.adblockplus.org' 10 SERVER = 'https://codereview.adblockplus.org'
11 UPLOADTOOL_URL = SERVER + '/static/upload.py' 11 UPLOADTOOL_URL = SERVER + '/static/upload.py'
12 12
13 cmdtable = {} 13 cmdtable = {}
14 command = cmdutil.command(cmdtable) 14 try:
15 15 command = cmdutil.command(cmdtable)
16 except:
Sebastian Noack 2018/08/02 17:13:21 Nit: Bare except is discouraged by PEP-8 (and woul
hub 2018/08/02 18:16:56 fixed.
Sebastian Noack 2018/08/02 19:11:30 I suppose catching AttributeError specifically wou
hub 2018/08/02 19:41:16 I was being broad, but yes that work.
17 from mercurial import registrar
18 command = registrar.command(cmdtable)
16 19
17 @command('review', 20 @command('review',
18 [ 21 [
19 ('i', 'issue', '', 'If given, adds a patch set to this review, othe rwise create a new one.', 'ISSUE'), 22 ('i', 'issue', '', 'If given, adds a patch set to this review, othe rwise create a new one.', 'ISSUE'),
20 ('r', 'revision', '', 'Revision to diff against or a revision range to upload.', 'REV'), 23 ('r', 'revision', '', 'Revision to diff against or a revision range to upload.', 'REV'),
21 ('c', 'change', '', 'A single revision to upload.', 'REV'), 24 ('c', 'change', '', 'A single revision to upload.', 'REV'),
22 ('t', 'title', '', 'New review subject or new patch set title.', 'T ITLE'), 25 ('t', 'title', '', 'New review subject or new patch set title.', 'T ITLE'),
23 ('m', 'message', '', 'New review description or new patch set messa ge.', 'MESSAGE'), 26 ('m', 'message', '', 'New review description or new patch set messa ge.', 'MESSAGE'),
24 ('w', 'reviewers', '', 'Add reviewers (comma separated email addres ses or @adblockplus.org user names).', 'REVIEWERS'), 27 ('w', 'reviewers', '', 'Add reviewers (comma separated email addres ses or @adblockplus.org user names).', 'REVIEWERS'),
25 ('', 'cc', '', 'Add CC (comma separated email addresses or @adblock plus.org user names).', 'CC'), 28 ('', 'cc', '', 'Add CC (comma separated email addresses or @adblock plus.org user names).', 'CC'),
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 </body> 163 </body>
161 </html> 164 </html>
162 ''' % port 165 ''' % port
163 166
164 # Run the upload tool 167 # Run the upload tool
165 issue, patchset = scope['RealMain']([upload_path] + args) 168 issue, patchset = scope['RealMain']([upload_path] + args)
166 169
167 # Wait for the page to check in and retrieve issue URL 170 # Wait for the page to check in and retrieve issue URL
168 if server: 171 if server:
169 server.handle_request() 172 server.handle_request()
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld