Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

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

The single app analytics solutions to take your web and mobile apps to the next level.  Try today!  Brought to you in partnership with CA Technologies

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/

CA App Experience Analytics, a whole new level of visibility. Learn more. Brought to you in partnership with CA Technologies.

Topics:

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}