comparison mercurial/patch.py @ 23429:f35526b999f4

patch.diffopts: use a dict for initialization In upcoming patches we'll conditionally add to and remove from the dict.
author Siddharth Agarwal <sid0@fb.com>
date Tue, 18 Nov 2014 16:00:54 -0800
parents f8b5c3e77d4b
children 3821be85fd4d
comparison
equal deleted inserted replaced
23428:b5e3f3d25395 23429:f35526b999f4
1566 return v 1566 return v
1567 if forceplain is not None and ui.plain(): 1567 if forceplain is not None and ui.plain():
1568 return forceplain 1568 return forceplain
1569 return getter(section, name or key, None, untrusted=untrusted) 1569 return getter(section, name or key, None, untrusted=untrusted)
1570 1570
1571 return mdiff.diffopts( 1571 buildopts = {
1572 text=opts and opts.get('text'), 1572 'text': opts and opts.get('text'),
1573 git=get('git'), 1573 'git': get('git'),
1574 nodates=get('nodates'), 1574 'nodates': get('nodates'),
1575 nobinary=get('nobinary'), 1575 'nobinary': get('nobinary'),
1576 noprefix=get('noprefix', forceplain=False), 1576 'noprefix': get('noprefix', forceplain=False),
1577 showfunc=get('show_function', 'showfunc'), 1577 'showfunc': get('show_function', 'showfunc'),
1578 ignorews=get('ignore_all_space', 'ignorews'), 1578 'ignorews': get('ignore_all_space', 'ignorews'),
1579 ignorewsamount=get('ignore_space_change', 'ignorewsamount'), 1579 'ignorewsamount': get('ignore_space_change', 'ignorewsamount'),
1580 ignoreblanklines=get('ignore_blank_lines', 'ignoreblanklines'), 1580 'ignoreblanklines': get('ignore_blank_lines', 'ignoreblanklines'),
1581 context=get('unified', getter=ui.config)) 1581 'context': get('unified', getter=ui.config),
1582 }
1583
1584 return mdiff.diffopts(**buildopts)
1582 1585
1583 def diff(repo, node1=None, node2=None, match=None, changes=None, opts=None, 1586 def diff(repo, node1=None, node2=None, match=None, changes=None, opts=None,
1584 losedatafn=None, prefix=''): 1587 losedatafn=None, prefix=''):
1585 '''yields diff of changes to files between two nodes, or node and 1588 '''yields diff of changes to files between two nodes, or node and
1586 working directory. 1589 working directory.