cornercorner
FeaturesPluginsDocs & SupportCommunityPartners

Bug 162718 - [67cat] .hg directory deleted after renaming a project
: [67cat] .hg directory deleted after renaming a project
Status: NEW
: projects
Generic Projects UI
: 6.0
: All All
: P2 (vote)
: 6.8
Assigned To:
:
:
:
: 6.7_WAIVER_APPROVED, 6.8_WAIVER_APPROVED
:
:
  Show dependency treegraph
 
Reported: 2009-04-15 13:46 by
Modified: 2009-09-18 07:59 (History)
Issue Type: DEFECT
:


Attachments
messages.log (165.73 KB, text/plain)
2009-04-15 13:47, aldobrucale
Details


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2009-04-15 13:46:41
[ BUILD # : 200904141401 ]
[ JDK VERSION : 1.6.* ]

I have renamed a module project, also renaming the directory. The .hg
directory isn't there any more (and I can't init mercurial from nb)
------- Comment #1 From 2009-04-15 13:47:27 -------
Created an attachment (id=80154) [details]
messages.log
------- Comment #2 From 2009-04-15 15:49:43 -------
the implementation behind the rename action creates a new folder, copies only
visible project files into it and deletes
then all files from the old project folder. 

Please evaluate.
------- Comment #3 From 2009-04-15 15:50:36 -------
reassigning to project api
------- Comment #4 From 2009-04-15 16:31:34 -------
Where was .hg directory? Was it inside project? In NB repository we have .hg
directory at root of source tree so rename
project should not touch .hg directory IMO.
------- Comment #5 From 2009-04-15 19:02:53 -------
I can confirm that any dot directory inside project folder is lost when project
is renamed and project folder is
renamed. Milan is it correct or is it bug?
------- Comment #6 From 2009-04-15 19:04:02 -------
I must add I tested with Java Application project.
------- Comment #7 From 2009-04-16 08:48:40 -------
Yes, the .hg directory was in the project dir
------- Comment #8 From 2009-04-16 09:44:53 -------
The issue is not a regression, not new either. Decreasing to P2.

It will be fixed for 6.7. The fix may simply be a warning to the user in the
Rename dialog that folders and files not
visible in Files view in NetBeans will not be preserved though. It's up to
further discussion.
------- Comment #9 From 2009-04-16 09:48:36 -------
Current behavior is by design. We must discuss what is 'correct' solution of
this. There is more aspects:
1.Generally we do not declare any limitation on file/folder names specific to
IDE. It means it is not good behavior that
file/folder which is considered as 'hidden' by IDE is lost when project is
renamed.
2.If given project is inside some VCS ie. it is *subdir* of some VCS tree
checkout then simple project folder rename can
break it. In such case workaround is to rename project without project folder
rename and then perform folder rename
using VCS support.

Possible solution is to add option to Project Rename dialog if hidden
files/folders should be handled or not with
warning about possible problem if hidden files are VCS metadata.
------- Comment #10 From 2009-04-28 14:53:03 -------
I'm in favor of having only big fat warning in the rename/copy/move dialog for
6.7. Because to do this correctly we
would need cooperation between project rename/copy/move operations and all
kinds of version control systems that have
invisible folders (beginning with '.') with metadata (CVS, SVN, Hg, ...).
Currently we do not have such support in VCS APIs.

Suggested warning:

"WARNING: If the project is under version control system the operation can
destroy metadata needed by the version
control system."

Reassigning to olangr to verify/provide warning message. Please reassign back.
------- Comment #11 From 2009-04-28 18:54:24 -------
The message seems OK to me, but I'm not a native speaker. 

However, it will not fix the problem, it will decrease it's severity and put
some of the responsibility from us to the
end user. I'd say that the message will decrease priority (possibly to P3), but
the problem persists (transforms into
"it is not possible to rename a version controlled project").
------- Comment #12 From 2009-04-28 23:00:34 -------
With a lack of a better solution for 6.7, let's show the warning.
------- Comment #13 From 2009-04-30 09:26:16 -------
Warning message implemented:

http://hg.netbeans.org/core-main/rev/4a23a61e4459

Decreasing priority to P3.
------- Comment #14 From 2009-05-01 08:11:12 -------
Integrated into 'main-golden', will be available in build *200905010201* on
http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/4a23a61e4459
User: Milan Kubec <mkubec@netbeans.org>
Log: #162718: providing warning message about renaming CVS controlled project
------- Comment #15 From 2009-05-04 12:04:30 -------
*** Issue 163793 has been marked as a duplicate of this issue. ***
------- Comment #16 From 2009-05-04 13:56:24 -------
Decreasing it to P3 doesn't seem to be appropriate..

As Renaming a project, means just* rename.. and user is not expected to be
aware copy/delete scenario.

I've tried looking at other IDE(s) and they JUST rename the folder instead of
re-creating a new folder.

Current behavior of Netbeans is not as per the user-experience guide lines. but
also error-prone as any thing might
happen while this big 'copy' process is going on..

for e.g. the process is crashed(or killed), developer is left with UNUSABLE
folder.

A better solution would be to JUST rename the existing folder. as it is cleaner
and does NOT require integration between
projects and VCS modules as the vcs-specific files are left intact.

If the mentioned solution is not possible, a better name for the operation
should be used instead of 'rename'.

Raising the priority to P2 as this impacts DATA-INTEGRITY.
------- Comment #17 From 2009-05-05 15:31:34 -------
We are aware of the problem and that's the reason for the big fat warning on
the dialogs to warn users that some data
may be destroyed.

On the other side the statement about "... does NOT require integration between
projects and VCS modules ..." is not
right either. If the project is versioned under VCS that we support we need to
take correct action depending on the
operation (move/copy/rename; all these operations are implemented together).
Currently we support number of VCS, e.g.
CVS, SVN, Hg and some others via modules on Autoupdate. Some of those VCS even
do not support those operations (e.g.
CVS), some of them yes. 

To implement those operations correctly we need to combine filesystem calls as
well as VCS calls depending on VCS. Given
the fact that NetBeans 6.7 is currently in stage Beta, there is no time do
implement correct fix for the problem. For
6.7 there will be only the warning.

The current functionality is in IDE probably from some 4.x release.

The functionality works without problems for non-versioned projects.
------- Comment #18 From 2009-06-08 08:03:50 -------
*** Issue 166692 has been marked as a duplicate of this issue. ***
------- Comment #19 From 2009-09-17 10:54:42 -------
And here is the way how to rename a project that is also root of hg repository:

1) Comit all changes to repository
2) *Outside of IDE* copy .hg folder and possible other .hg files (e.g.
.hgignore) to backup location
3) Rename the project in IDE (.hg metadata are deleted)
4) Close IDE
5) Copy all .hg metadata (from point 2) back to the project
6) Start IDE

I might try to come up with better warning message on the dialog.
------- Comment #20 From 2009-09-17 15:57:41 -------
I'd suggest creating two messages:  the first for Rename and Move operations,
the second for the Copy operation:

*Rename, Move:*

    WARNING: This operation will not copy over hidden files.  If this project
is under version control, this operation
can delete the metadata required by the version control system you are using.

*Copy:*

    WARNING: This operation will not copy over hidden files.  If this project
is under version control, the new project
copy will not include the metadata required by the version control system you
are using.
------- Comment #21 From 2009-09-17 16:03:50 -------
I'd suggest creating two messages:  the first for Rename and Move operations,
the second for the Copy operation:

*Rename, Move:*

    WARNING: This operation will not copy over hidden files.  If this project
is under version control, this operation
can delete the metadata required by the version control system you are using.

*Copy:*

    WARNING: This operation will not copy over hidden files.  If this project
is under version control, the new project
copy will not include the metadata required by the version control system you
are using.
------- Comment #22 From 2009-09-18 07:59:58 -------
Unfortunatelly, Copy dialog and Move dialog uses the same UI, so currently it's
not possible to use different message.
I've used "Rename, Move" message also for "Copy".