# HG changeset patch # User Phil Cohen # Date 1503635200 25200 # Node ID f39ba8237ed60fbd338be2df6f44bbcc49dd36c4 # Parent f488223a87ab5325a05011b8ad913e9628a0a367 simplemerge: use `ctx.decoddeddata()` instead of `repo.wreaddata` This eliminates the need for the `repo` object. Differential Revision: https://phab.mercurial-scm.org/D435 diff -r f488223a87ab -r f39ba8237ed6 mercurial/simplemerge.py --- a/mercurial/simplemerge.py Thu Aug 24 21:26:40 2017 -0700 +++ b/mercurial/simplemerge.py Thu Aug 24 21:26:40 2017 -0700 @@ -438,15 +438,14 @@ def readctx(ctx): if not ctx: return None - if not repo: - raise error.ProgrammingError('simplemerge: repo must be passed if ' - 'using contexts') - # `wwritedata` is used to get the post-filter data from `ctx` (i.e., - # what would have been in the working copy). Since merges were run in - # the working copy, and thus used post-filter data, we do the same to - # maintain behavior. - return repo.wwritedata(ctx.path(), - _verifytext(ctx.data(), ctx.path(), ui, opts)) + # Merges were always run in the working copy before, which means + # they used decoded data, if the user defined any repository + # filters. + # + # Maintain that behavior today for BC, though perhaps in the future + # it'd be worth considering whether merging encoded data (what the + # repository usually sees) might be more useful. + return _verifytext(ctx.decodeddata(), ctx.path(), ui, opts) class ctxwriter(object): def __init__(self, ctx):