[PATCH 1 of 2] patch: add new diffopt filenameonly

Simon King simon at simonking.org.uk
Tue Aug 11 11:10:37 CDT 2015


On Tue, Aug 11, 2015 at 2:03 PM, Laurent Charignon <lcharignon at fb.com> wrote:
> # HG changeset patch
> # User Laurent Charignon <lcharignon at fb.com>
> # Date 1439295186 25200
> #      Tue Aug 11 05:13:06 2015 -0700
> # Node ID e3166b55525d48d0b69231d793ef2918046320e0
> # Parent  a7527c5769bbe9e6a5afda9e615ad40e69665e9e
> patch: add new diffopt filenameonly
>
> This series of patches adds a --filenameonly flag to hg diff --stat to only
> display the filenames and omit the number of changes and summary line.
>
> I had the need for this feature trying to compute the list of files that changed
> between two branches with:
>
> hg log -T {files % "{file}\\n"} -r 'only(r1,r2)'
>  and having to pipe the result to sort, uniq to get the list of file that
>  changed between the branches without duplicates
>
> hg diff -r r1 -r r2 --stat
>  gave the right result but required parsing the output to eliminate the +,- and
>  summary line
>
> This series solves this issues with a new flag that combines with --stat:
>  hg diff -r r1 -r r2 --stat --filenameonly
>

Isn't "hg status --rev r1 --rev r2" supposed to give the same result?

(I seem to remember some caveats around files where the same change is
made on different branches, but I'm not sure of the details)

Simon


More information about the Mercurial-devel mailing list