I just added a new section about some tips and tricks to my blog series about Distributed version Control Systems (DVCS) Git and Mercurial.
and here’s the first tip:
the problem: copy – paste/replace existing files
If you want to copy a file from one project to another, where the same file already exists, you would expect, that the DVCS recognizes this and marks the file as dirty, if the content changed.
Because of Bug 269067 this will fail, if you’re using the Java Package Explorer.
short demonstration – file under DVCS control – in this case EGit – same using hgeclipse:
after pasting a file ‘abc.txt‘ from another project:
the file is marked to delete – and after commit:
the first file is removed, the pasted file has to be added / committed as new and your history is gone.
here’s the workaround: copy/paste from Navigator - then it works well:
the file is marked as changed. Reading comments of Bug 269067 in some cases the Project Explorer should work, but not for me under OSX.
Please copy – paste/replace existing files only from Navigator View – otherwise your history is lost and you have to add the pasted file.
Watch Bugzilla 269067 to get notified if this is fixed – or follow my blogs or twitter @ekkescorner