Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/obsutil.py @ 38523:4455e5d4d59c
context: explicitly take diffopts in `context.diff` (API)
To provide a proper replacement for the `patch.diff(?)` function, the
`context.diff(?)` method needs to be able to take more parameters. To
distinguish the diff options from the new other arguments, we upgrade the diff
options to its own explicit argument.
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Tue, 22 May 2018 15:02:52 +0200 |
parents | 11d51e518808 |
children | f65e6095c5ac |
comparison
equal
deleted
inserted
replaced
38522:cf24f678adda | 38523:4455e5d4d59c |
---|---|
394 """ | 394 """ |
395 | 395 |
396 # Leftctx or right ctx might be filtered, so we need to use the contexts | 396 # Leftctx or right ctx might be filtered, so we need to use the contexts |
397 # with an unfiltered repository to safely compute the diff | 397 # with an unfiltered repository to safely compute the diff |
398 leftunfi = leftctx._repo.unfiltered()[leftctx.rev()] | 398 leftunfi = leftctx._repo.unfiltered()[leftctx.rev()] |
399 leftdiff = leftunfi.diff(git=1) | 399 leftdiff = leftunfi.diff(opts={'git': True}) |
400 rightunfi = rightctx._repo.unfiltered()[rightctx.rev()] | 400 rightunfi = rightctx._repo.unfiltered()[rightctx.rev()] |
401 rightdiff = rightunfi.diff(git=1) | 401 rightdiff = rightunfi.diff(opts={'git': True}) |
402 | 402 |
403 left, right = (0, 0) | 403 left, right = (0, 0) |
404 while None not in (left, right): | 404 while None not in (left, right): |
405 left = _getdifflines(leftdiff) | 405 left = _getdifflines(leftdiff) |
406 right = _getdifflines(rightdiff) | 406 right = _getdifflines(rightdiff) |