# HG changeset patch # User Gábor Stefanik # Date 2016-07-25 15:00:42 # Node ID 53e2c979e4cd288f7129717b37966ab4b2afac11 # Parent 387bdd53c77e9f61bd7b0d491717440f7f57563a graft: use opts.get() consistently Make life easier for extension writers. diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4089,12 +4089,12 @@ def graft(ui, repo, *revs, **opts): 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 @@ def _dograft(ui, repo, *revs, **opts): 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"))