chrono028 / mercurialeclipse

Automatically exported from code.google.com/p/mercurialeclipse
Other
0 stars 0 forks source link

HGE tries to manage projects which have the same name as previously removed hg-controlled ones #21

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
(originally reported here [1])

Consider the following directory structure:
root\A\.hg
root\A\someproject
root\B\someproject

1. import root/A/someproject. It will be correctly identified as 
version-controlled by mercurial.
2. remove someproject from workspace
3. import root/B/someproject. 

Most often I get "abort: There is no Mercurial repository here (.hg not 
found)!" errors and projects get decorated with hg revisions, but sometimes 
this problem manifests itself in different kind of errors. I don't remember 
them all, but will add them later if needed.

If I restart eclipse after step 2 everything works as expected. 

The patch attached resolves the issue for me.

[1] http://javaforge.com/issue/13076

Original issue reported on code.google.com by allat...@gmail.com on 28 Nov 2010 at 4:02

Attachments:

GoogleCodeExporter commented 8 years ago
Thanks for the patch! Can you confirm the problem occurs with the latest 
snapshot?

Original comment by johnpeb@gmail.com on 28 Nov 2010 at 8:46

GoogleCodeExporter commented 8 years ago
Hi,

actually my last change should do the same: 
see 
http://code.google.com/a/eclipselabs.org/p/mercurialeclipse/source/detail?r=4207
cf813c44cfce867bb5a75b8017af1cf05694

What is the reason for the patch now?

Does the disconect() not work for you?

Regards,
Andrei

Original comment by iloveeclipse on 28 Nov 2010 at 8:50

GoogleCodeExporter commented 8 years ago
Made my patch against b4b3c05238.
Expression of the main conditional block in HgMoveDeleteHook#deleteProject(...) 
made my to think that it was dealing with physical files removal, so I skipped 
in-depth analysis if it.
While debugging the issue I always removed projects with "Delete project 
contents?" unchecked. As a result, disconnect() was skipped and I'm sure you 
will understand the rest.
IMO, disconnect() should be called even if project is not removed from the disk.

Original comment by allat...@gmail.com on 28 Nov 2010 at 9:31

GoogleCodeExporter commented 8 years ago
Ok, I've pushed a slightly modified version - can you try it out?

I would not like to disconnect early, as we may still need some data (like 
hgroot<->project cache) during this call. So I've put disconnect near to the 
end in all three cases.
CU
Andrei

Original comment by iloveeclipse on 28 Nov 2010 at 10:10

GoogleCodeExporter commented 8 years ago
729333e989 resolves the issue.
Thanks!

Original comment by allat...@gmail.com on 28 Nov 2010 at 10:51

GoogleCodeExporter commented 8 years ago
Thank you for report & review.
Closing as fixed.
CU
Andrei

Original comment by iloveeclipse on 28 Nov 2010 at 10:54

GoogleCodeExporter commented 8 years ago

Original comment by johnpeb@gmail.com on 6 Dec 2010 at 12:20