Over a million developers have joined DZone.

DVCS Tips and Tricks: Don’t Copy/Paste Using Java Package Explorer

DZone's Guide to

DVCS Tips and Tricks: Don’t Copy/Paste Using Java Package Explorer

· Java Zone ·
Free Resource

Atomist automates your software deliver experience. It's how modern teams deliver modern software.

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.

the workaround

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 ;-)

From http://ekkescorner.wordpress.com/2010/04/05/dvcs-tips-and-tricks-dont-copypaste-using-java-package-explorer/

Get the open source Atomist Software Delivery Machine and start automating your delivery right there on your own laptop, today!


Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}