##// END OF EJS Templates
patch.difffeatureopts: add a feature for diff.git...
Siddharth Agarwal -
r23432:27af986a default
parent child Browse files
Show More
@@ -1564,8 +1564,12 b' def diffallopts(ui, opts=None, untrusted'
1564 1564
1565 1565 diffopts = diffallopts
1566 1566
1567 def difffeatureopts(ui, opts=None, untrusted=False, section='diff'):
1568 '''return diffopts with only opted-in features parsed'''
1567 def difffeatureopts(ui, opts=None, untrusted=False, section='diff', git=False):
1568 '''return diffopts with only opted-in features parsed
1569
1570 Features:
1571 - git: git-style diffs
1572 '''
1569 1573 def get(key, name=None, getter=ui.configbool, forceplain=None):
1570 1574 if opts:
1571 1575 v = opts.get(key)
@@ -1577,7 +1581,6 b' def difffeatureopts(ui, opts=None, untru'
1577 1581
1578 1582 buildopts = {
1579 1583 'text': opts and opts.get('text'),
1580 'git': get('git'),
1581 1584 'nodates': get('nodates'),
1582 1585 'nobinary': get('nobinary'),
1583 1586 'noprefix': get('noprefix', forceplain=False),
@@ -1588,6 +1591,9 b' def difffeatureopts(ui, opts=None, untru'
1588 1591 'context': get('unified', getter=ui.config),
1589 1592 }
1590 1593
1594 if git:
1595 buildopts['git'] = get('git')
1596
1591 1597 return mdiff.diffopts(**buildopts)
1592 1598
1593 1599 def diff(repo, node1=None, node2=None, match=None, changes=None, opts=None,
General Comments 0
You need to be logged in to leave comments. Login now