DVCS Tips and Tricks: don’t copy/paste using Java Package Explorer

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ūüėČ

3 responses

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: