[PATCH 7 of 9] patch: add a diffhunks function yielding (diffheaders, hunks)

Denis Laxalde denis at laxalde.org
Mon Mar 6 04:52:20 EST 2017


Denis Laxalde a écrit :
> # HG changeset patch
> # User Denis Laxalde <denis.laxalde at logilab.fr>
> # Date 1488558011 -3600
> #      Fri Mar 03 17:20:11 2017 +0100
> # Node ID 2b3bbcb8cca52db9e0dae20dbf028b67a39abc7c
> # Parent  07ea362d18b8d2b046822894ecdaded1dc889429
> # Available At http://hg.logilab.org/users/dlaxalde/hg
> #              hg pull http://hg.logilab.org/users/dlaxalde/hg -r 2b3bbcb8cca5
> # EXP-Topic diffhunks
> patch: add a diffhunks function yielding (diffheaders, hunks)

It seems to me that this function could replace the combined use of
patch.diff() + patch.parsepatch() that occurs in cmdutil.dorecord for
instance: 
https://www.mercurial-scm.org/repo/hg/file/4.1.1/mercurial/cmdutil.py#l166
Also, I did not make use of existing "patch" data structures (classes
header and hunk in patch module in particular), but it might be worth
considering using them, in particular if we make cmdutil.dorecord() use
patch.diffhunks().


More information about the Mercurial-devel mailing list