mercurial/patch.py
changeset 23295 ac072c79bd9d
parent 22460 c343557a8442
child 23296 922fcfb02e77
equal deleted inserted replaced
23294:ec8c73b02e2e 23295:ac072c79bd9d
  1557 
  1557 
  1558 class GitDiffRequired(Exception):
  1558 class GitDiffRequired(Exception):
  1559     pass
  1559     pass
  1560 
  1560 
  1561 def diffopts(ui, opts=None, untrusted=False, section='diff'):
  1561 def diffopts(ui, opts=None, untrusted=False, section='diff'):
  1562     def get(key, name=None, getter=ui.configbool):
  1562     def get(key, name=None, getter=ui.configbool, forceplain=None):
  1563         return ((opts and opts.get(key)) or
  1563         if opts:
  1564                 getter(section, name or key, None, untrusted=untrusted))
  1564             v = opts.get(key)
       
  1565             if v:
       
  1566                 return v
       
  1567         return getter(section, name or key, None, untrusted=untrusted)
       
  1568 
  1565     return mdiff.diffopts(
  1569     return mdiff.diffopts(
  1566         text=opts and opts.get('text'),
  1570         text=opts and opts.get('text'),
  1567         git=get('git'),
  1571         git=get('git'),
  1568         nodates=get('nodates'),
  1572         nodates=get('nodates'),
  1569         nobinary=get('nobinary'),
  1573         nobinary=get('nobinary'),