##// END OF EJS Templates
diffutil: remove diffopts() in favor of diffallopts()...
Yuya Nishihara -
r38606:b62000a2 default
parent child Browse files
Show More
@@ -196,7 +196,7 b' def analyze(ui, repo, *revs, **opts):'
196 if lastctx.rev() != nullrev:
196 if lastctx.rev() != nullrev:
197 timedelta = ctx.date()[0] - lastctx.date()[0]
197 timedelta = ctx.date()[0] - lastctx.date()[0]
198 interarrival[roundto(timedelta, 300)] += 1
198 interarrival[roundto(timedelta, 300)] += 1
199 diffopts = diffutil.diffopts(ui, {'git': True})
199 diffopts = diffutil.diffallopts(ui, {'git': True})
200 diff = sum((d.splitlines()
200 diff = sum((d.splitlines()
201 for d in ctx.diff(pctx, opts=diffopts)), [])
201 for d in ctx.diff(pctx, opts=diffopts)), [])
202 fileadds, diradds, fileremoves, filechanges = 0, 0, 0, 0
202 fileadds, diradds, fileremoves, filechanges = 0, 0, 0, 0
@@ -395,7 +395,7 b' def _cmpdiff(leftctx, rightctx):'
395
395
396 This is a first and basic implementation, with many shortcoming.
396 This is a first and basic implementation, with many shortcoming.
397 """
397 """
398 diffopts = diffutil.diffopts(leftctx.repo().ui, {'git': True})
398 diffopts = diffutil.diffallopts(leftctx.repo().ui, {'git': True})
399 # Leftctx or right ctx might be filtered, so we need to use the contexts
399 # Leftctx or right ctx might be filtered, so we need to use the contexts
400 # with an unfiltered repository to safely compute the diff
400 # with an unfiltered repository to safely compute the diff
401 leftunfi = leftctx._repo.unfiltered()[leftctx.rev()]
401 leftunfi = leftctx._repo.unfiltered()[leftctx.rev()]
@@ -2233,7 +2233,7 b' def changedfiles(ui, repo, patchpath, st'
2233 class GitDiffRequired(Exception):
2233 class GitDiffRequired(Exception):
2234 pass
2234 pass
2235
2235
2236 diffopts = diffutil.diffopts
2236 diffopts = diffutil.diffallopts
2237 diffallopts = diffutil.diffallopts
2237 diffallopts = diffutil.diffallopts
2238 difffeatureopts = diffutil.difffeatureopts
2238 difffeatureopts = diffutil.difffeatureopts
2239
2239
@@ -1805,7 +1805,7 b' def matching(repo, subset, x):'
1805 'substate': lambda r: repo[r].substate,
1805 'substate': lambda r: repo[r].substate,
1806 'summary': lambda r: repo[r].description().splitlines()[0],
1806 'summary': lambda r: repo[r].description().splitlines()[0],
1807 'diff': lambda r: list(repo[r].diff(
1807 'diff': lambda r: list(repo[r].diff(
1808 opts=diffutil.diffopts(repo.ui, {'git': True}))),
1808 opts=diffutil.diffallopts(repo.ui, {'git': True}))),
1809 }
1809 }
1810 for info in fields:
1810 for info in fields:
1811 getfield = _funcs.get(info, None)
1811 getfield = _funcs.get(info, None)
@@ -265,7 +265,7 b' def showdiffstat(context, mapping):'
265 """
265 """
266 ui = context.resource(mapping, 'ui')
266 ui = context.resource(mapping, 'ui')
267 ctx = context.resource(mapping, 'ctx')
267 ctx = context.resource(mapping, 'ctx')
268 diffopts = diffutil.diffopts(ui, {'noprefix': False})
268 diffopts = diffutil.diffallopts(ui, {'noprefix': False})
269 diff = ctx.diff(opts=diffopts)
269 diff = ctx.diff(opts=diffopts)
270 stats = patch.diffstatdata(util.iterlines(diff))
270 stats = patch.diffstatdata(util.iterlines(diff))
271 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
271 maxname, maxtotal, adds, removes, binary = patch.diffstatsum(stats)
@@ -21,8 +21,6 b' def diffallopts(ui, opts=None, untrusted'
21 return difffeatureopts(ui, opts=opts, untrusted=untrusted, section=section,
21 return difffeatureopts(ui, opts=opts, untrusted=untrusted, section=section,
22 git=True, whitespace=True, formatchanging=True)
22 git=True, whitespace=True, formatchanging=True)
23
23
24 diffopts = diffallopts
25
26 def difffeatureopts(ui, opts=None, untrusted=False, section='diff', git=False,
24 def difffeatureopts(ui, opts=None, untrusted=False, section='diff', git=False,
27 whitespace=False, formatchanging=False):
25 whitespace=False, formatchanging=False):
28 '''return diffopts with only opted-in features parsed
26 '''return diffopts with only opted-in features parsed
@@ -77,7 +77,7 b' ctxb = context.memctx(repo, [ctxa.node()'
77 print(ctxb.status(ctxa))
77 print(ctxb.status(ctxa))
78
78
79 # test performing a diff on a memctx
79 # test performing a diff on a memctx
80 diffopts = diffutil.diffopts(repo.ui, {'git': True})
80 diffopts = diffutil.diffallopts(repo.ui, {'git': True})
81 for d in ctxb.diff(ctxa, opts=diffopts):
81 for d in ctxb.diff(ctxa, opts=diffopts):
82 printb(d, end=b'')
82 printb(d, end=b'')
83
83
General Comments 0
You need to be logged in to leave comments. Login now