436 return _verifytext(text, filename, ui, opts) |
436 return _verifytext(text, filename, ui, opts) |
437 |
437 |
438 def readctx(ctx): |
438 def readctx(ctx): |
439 if not ctx: |
439 if not ctx: |
440 return None |
440 return None |
441 if not repo: |
441 # Merges were always run in the working copy before, which means |
442 raise error.ProgrammingError('simplemerge: repo must be passed if ' |
442 # they used decoded data, if the user defined any repository |
443 'using contexts') |
443 # filters. |
444 # `wwritedata` is used to get the post-filter data from `ctx` (i.e., |
444 # |
445 # what would have been in the working copy). Since merges were run in |
445 # Maintain that behavior today for BC, though perhaps in the future |
446 # the working copy, and thus used post-filter data, we do the same to |
446 # it'd be worth considering whether merging encoded data (what the |
447 # maintain behavior. |
447 # repository usually sees) might be more useful. |
448 return repo.wwritedata(ctx.path(), |
448 return _verifytext(ctx.decodeddata(), ctx.path(), ui, opts) |
449 _verifytext(ctx.data(), ctx.path(), ui, opts)) |
|
450 |
449 |
451 class ctxwriter(object): |
450 class ctxwriter(object): |
452 def __init__(self, ctx): |
451 def __init__(self, ctx): |
453 self.ctx = ctx |
452 self.ctx = ctx |
454 self.text = "" |
453 self.text = "" |