Mercurial > hg
diff mercurial/commands.py @ 29632:53e2c979e4cd stable
graft: use opts.get() consistently
Make life easier for extension writers.
author | Gábor Stefanik <gabor.stefanik@nng.com> |
---|---|
date | Mon, 25 Jul 2016 17:00:42 +0200 |
parents | 9c3786713926 |
children | 9b6dc989f02b |
line wrap: on
line diff
--- a/mercurial/commands.py Mon Jul 25 12:00:55 2016 -0700 +++ b/mercurial/commands.py Mon Jul 25 17:00:42 2016 +0200 @@ -4089,12 +4089,12 @@ return _dograft(ui, repo, *revs, **opts) def _dograft(ui, repo, *revs, **opts): - if revs and opts['rev']: + if revs and opts.get('rev'): ui.warn(_('warning: inconsistent use of --rev might give unexpected ' 'revision ordering!\n')) revs = list(revs) - revs.extend(opts['rev']) + revs.extend(opts.get('rev')) if not opts.get('user') and opts.get('currentuser'): opts['user'] = ui.username() @@ -4104,7 +4104,7 @@ editor = cmdutil.getcommiteditor(editform='graft', **opts) cont = False - if opts['continue']: + if opts.get('continue'): cont = True if revs: raise error.Abort(_("can't specify --continue and revisions"))