I’m trying to setup a shortcut, a command which will let me check the history of one file.
I’m interested in when the file was originally commited, in what changesets it was changed and whether the current version in the working directory differs from the “last commited one”.
So, in general
hg log --verbose filename.txt
hg status filename.txt
Is there a way to make this into a sort of a shortcut, so I can just type for example
hg file filename.txt
and get the “history” of the file?
Yes, you can add a shell alias:
The
$HGenvironment variable refers to the path of thehgscript used to invoke the shell alias, just in casehgis not in your path. The$1refers to the first command line argument, the file name in your case.