On Thu, 12 Apr 2018 09:51:53 -0700, Gregory Szorc wrote:
> > +    if fm.isplain():
> > +        chunkiter = patch.diffui(repo, prev, node, match, opts=diffopts)
> > +        for chunk, label in chunkiter:
> > +            fm.plain(chunk, label=label)
> > +    else:
> > +        chunkiter = patch.diff(repo, prev, node, match, opts=diffopts)
> > +        # TODO: make it structured?
> > +        fm.data(diff=b''.join(chunkiter))
> >
> 
> A concern I have is that we'll want to keep the door open for writing the
> diff chunks in a structured manner. That would seemingly require a
> different key for the templater. But I think "diff" is fine as the key that
> means "a textual diff format recognized by most patch tools." We can
> introduce a "diffparts" (or similar) and make "diff" lazily evaluate as
> follow-ups, when needed.

Yes. Since the key "diff" is used by 'log -Tjson -p', we'll have to leave it
as a textual diff.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to