From command line, you can issue hg copy <old name> <new name>
. Mercurial does save the history log when you perform copy or rename (hg cp
/ hg mv
).
In TortoiseHG the copy is a bit tricky: you have to copy the file manually (e.g. via cp
), then in THG in Commit
mode right-click at the left low pane with the unversioned new file and select Detect renames
. Uncheck Only consider deleted files
, let TortoiseHG find similar files and click the source file when it finishes. TortoiseHG will record the new file as a copy.
I haven't found a simpler way.
When viewing history from command line, you need to specify -f
(or --follow
) when you are viewing the history: hg log -f <filename>
. TortoiseHG already does that.