How-to diff across a renaming?

Marcos Cruz mercurial-list at programandala.net
Sun Feb 5 07:20:37 UTC 2023


Sietse Brouwer escribió/skribis/wrote/scrit (2023-02-04T13:35:01+0100):

> ```
> [alias]
> # crossdiff: compare two files with different names and revisions
> # Usage: hg crossdiff rev1 file1 rev2 file2
> crossdiff = !
>     # compute filenames
>     from_tmp="/tmp/from.$2.at.$1.tmp"
>     to_tmp="/tmp/to.$4.at.$3.tmp"
>     # materialize files
>     hg cat -r "$1" "$2" > "$from_tmp"
>     hg cat -r "$3" "$4" > "$to_tmp"
>     # diff using git
>     git diff "$from_tmp" "$to_tmp"
> ```

> hg crossdiff 0 eggfile 2 chickenfile

Good idea, thank you. I'll write it as an external script and will add
an additional parameter to select the diff tool.

> It might not work if you're on Windows

I use Debian, no problem.


-- 
Marcos Cruz
http://programandala.net


More information about the Mercurial mailing list