D5628: diffstat: make --git work properly on renames (issue6025)

Yuya Nishihara yuya at tcha.org
Sat Jan 26 05:16:38 UTC 2019


> @@ -2808,6 +2808,10 @@
>          elif (line.startswith('GIT binary patch') or
>                line.startswith('Binary file')):
>              isbinary = True
> +        elif line.startswith('rename from'):
> +            filename = line.split()[-1]
> +        elif line.startswith('rename to'):
> +            filename += ' => %s' % line.split()[-1]

Nice.

One nit: better to not use `.split()` since a filename may include whitespace.



More information about the Mercurial-devel mailing list