# HG changeset patch # User Siddharth Agarwal # Date 2014-11-13 07:44:17 # Node ID ac072c79bd9d4005d793eb94a01d5cb961e7f7bc # Parent ec8c73b02e2eb791e59e3137700522d62674b893 patch.diffopts: break get function into if statements We're going to add another condition here, and with the current structure that becomes just too confusing. diff --git a/mercurial/patch.py b/mercurial/patch.py --- a/mercurial/patch.py +++ b/mercurial/patch.py @@ -1559,9 +1559,13 @@ class GitDiffRequired(Exception): pass def diffopts(ui, opts=None, untrusted=False, section='diff'): - def get(key, name=None, getter=ui.configbool): - return ((opts and opts.get(key)) or - getter(section, name or key, None, untrusted=untrusted)) + def get(key, name=None, getter=ui.configbool, forceplain=None): + if opts: + v = opts.get(key) + if v: + return v + return getter(section, name or key, None, untrusted=untrusted) + return mdiff.diffopts( text=opts and opts.get('text'), git=get('git'),