# HG changeset patch # User Patrick Mezard # Date 2012-08-01 13:49:00 # Node ID 2e0805f5973668efcc6e61d446c5ea74811898c1 # Parent a028ce66e2b7d608344e7b5b5c1a55e4a6ac54b5 log: make opts entries optional (issue2423) diff --git a/mercurial/cmdutil.py b/mercurial/cmdutil.py --- a/mercurial/cmdutil.py +++ b/mercurial/cmdutil.py @@ -996,7 +996,7 @@ def walkchangerevs(repo, match, opts, pr defrange = '%s:0' % repo['.'].rev() else: defrange = '-1:0' - revs = scmutil.revrange(repo, opts['rev'] or [defrange]) + revs = scmutil.revrange(repo, opts.get('rev') or [defrange]) if not revs: return [] wanted = set() diff --git a/mercurial/commands.py b/mercurial/commands.py --- a/mercurial/commands.py +++ b/mercurial/commands.py @@ -4074,7 +4074,7 @@ def log(ui, repo, *pats, **opts): getrenamed = templatekw.getrenamedfn(repo, endrev=endrev) df = False - if opts["date"]: + if opts.get("date"): df = util.matchdate(opts["date"]) branches = opts.get('branch', []) + opts.get('only_branch', [])