Index: hgreview.py |
=================================================================== |
--- a/hgreview.py |
+++ b/hgreview.py |
@@ -47,17 +47,21 @@ |
if (not opts.get('no_mail') and |
(not opts.get('issue') or opts.get('message'))): |
args.append('--send_mail') |
if opts.get('revision') and opts.get('change'): |
raise error.Abort('Ambiguous revision range, only one of --revision and --change can be specified.') |
if opts.get('change'): |
- rev = repo[opts['change']] |
+ try: |
+ rev_no = int(opts['change']) |
+ except ValueError: |
+ raise error.Abort('Argument of --change must be an integer') |
hub
2018/10/01 16:06:14
I'm not sure I understand correctly. Do you bail i
Vasily Kuznetsov
2018/10/01 16:32:51
Yeah, it seems that repo[x] kind of expects x to b
Vasily Kuznetsov
2018/10/02 10:06:44
I switched to using repo.revs() API. It's not docu
|
+ rev = repo[rev_no] |
args.extend(['--rev', '{}:{}'.format(rev.parents()[0], rev)]) |
elif opts.get('revision'): |
args.extend(['--rev', opts['revision']]) |
else: |
raise error.Abort('What should be reviewed? Either --revision or --change is required.') |
if not opts.get('issue'): |
# New issue, make sure title and message are set |