Mercurial has an
hg copy file file2
command and the change can propagate change at the first merge. The O'Reilly Mercurial book says that Mercurial is the only source control system that does that.
What is a practical use of this? The book mentioned making a copy of the file and do bug fix, so the bug fix can propagate back to the original file, but with version control, don't we usually edit the file directly, and if the bug fix works, then directly commit that file? Or even if for some reason we need to make a copy, we can cp file file2
, test the fix, and mv file2 file
to move that file back to the original file, and commit the file. What is a good example of using the hg copy
feature?