I would like to reproduce this in python:
gvimdiff <(hg cat file.txt) file.txt
(hg cat file.txt displays the latest version of file.txt)
I know how to transfer a file to gvimdiff, but it will not accept another file:
$ hg cat file.txt | gvimdiff file.txt - Too many edit arguments: "-"
How to get to the python part ...
# hgdiff.py import subprocess import sys file = sys.argv[1] subprocess.call(["gvimdiff", "<(hg cat %s)" % file, file])
When a subprocess is called, it simply passes <(hg cat file) to gvimdiff as the file name.
So, is there a way to redirect the command as bash? For simplicity, just write the file and redirect it to diff:
diff <(cat file.txt) file.txt
redirect python bash diff vimdiff
alif
source share