This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 65366 - [50cat] REGRESSION: Cannot change CVSROOT for a folder inside NetBeans
Summary: [50cat] REGRESSION: Cannot change CVSROOT for a folder inside NetBeans
Status: RESOLVED FIXED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: CVS (show other bugs)
Version: 5.x
Hardware: All All
: P2 blocker with 6 votes (vote)
Assignee: issues@versioncontrol
URL:
Keywords:
Depends on: 66404
Blocks:
  Show dependency tree
 
Reported: 2005-09-29 15:57 UTC by misterm
Modified: 2007-01-04 17:14 UTC (History)
4 users (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments
Initial module code (10.55 KB, application/x-compressed)
2005-10-08 03:47 UTC, misterm
Details
Initial module code, with problems fixed. Should open now. (9.67 KB, application/x-compressed)
2005-10-10 21:39 UTC, misterm
Details
Reworked version of the module (10.13 KB, application/x-compressed)
2005-10-18 19:33 UTC, misterm
Details

Note You need to log in before you can comment on or make changes to this bug.
Description misterm 2005-09-29 15:57:38 UTC
It is not possible to change the CVSROOT for a existing folder. It used to be 
possible in 4.1 and is a showstopper for someone using CVS from NetBeans only 
and accessing a CVS repository inside and outside a company, for example.
Comment 1 clever 2005-09-30 02:11:06 UTC
I do miss the versioning manager. Gets my vote.
Comment 2 Maros Sandor 2005-09-30 09:22:31 UTC
We know about this, it's not a common usecase and did not get high enough in our
priority list. We may implement a workaround for FCS. It's not probable it will
appear in GUI though, would a -J-Dcvsroot1=cvsroot2 property be sufficient in
your case?
Comment 3 misterm 2005-10-01 05:45:46 UTC
>> ------- Additional comments from msandor Fri Sep 30 08:22:31 +0000 2005 -------

>> We know about this, it's not a common usecase and did not get high enough in 
>> our priority list. 

I'm surprised it's not a common use case. If you are a consultant and works on
customer site and at home or if you need to access your company's CVS server
from a customer, you do need this in order to _use_ the built-in CVS support!
Otherwise, it's useless for such people (including me).

>> We may implement a workaround for FCS. 

Is there anything I can do to help you?

>> It's not probable it will appear in GUI though, would a -J-Dcvsroot1=cvsroot2
>> property be sufficient in your case?

No, since I need to work with several cvsroots at a time and would need to 
change these settings every time.
Comment 4 Maros Sandor 2005-10-04 16:42:58 UTC
Can you give us examples of CVSROOTs and network setups you use? I mean, at
customer I need this one, in my company this one. You need to work with the same
local workdir but access it AS IF it were checked out using some other cvsroot?
Does this mean that server name changes across networks you use, or is it the
connection method or username? Thanks.
Comment 5 misterm 2005-10-04 18:00:50 UTC
There are two use cases for this:

1. Working at customer site/outside it: in this case, the customer site CVSROOT 
might be :pserver:user@10.2.x.x:/a/dir and external might 
be :pserver:user@200.x.x.x:/3500/a/dir (notice the port might change as well). 
It _is_ the same CVS server and it's very common for companies to implement 
such a setup.
2. Use another username for specific tasks: if one uses java.net CVS support, 
for example, there are commits that should be ignored for CVS statistics, such 
as publishing the project site using Maven (an automated task, that adds 
several folders/files to the www directory, for example). The best way to do 
this is to use a different login for such operations.

Hope I've helped to clarify the need for this.
Comment 6 _ pkuzel 2005-10-05 09:05:59 UTC
Is not is possible to address case 1 at DNS level? Use symbolic name
:pserver:user@servername:/a/dir and setup resolver so the servername is properly
translated to IP.

Comment 7 misterm 2005-10-05 11:21:20 UTC
>> ------- Additional comments from pkuzel Wed Oct 5 08:05:59 +0000 2005 -------
>> Is not is possible to address case 1 at DNS level? Use symbolic name
>> :pserver:user@servername:/a/dir and setup resolver so the servername is 
>> properly translated to IP

1. Port number changes as well, so even if this solution was feasible, it 
wouldn't work;
2. Developers using NB usually are not network administrators, so they are not 
allowed to change the way networks are configured;
3. Instead of changing the way environments work, the IDE is supposed to adapt 
for it;
4. Old CVS supported it, there is no reason not to support it for new CVS.
Comment 8 _ pkuzel 2005-10-05 14:26:02 UTC
There are serious consequences connected with it. Our library impl fails on it.

My current idea is to provide a separate module that would provide a workdir
CVSROOT switching functionality. After intalling the module (may be from Beta
AUC or as separate download) there would be Workdir Manager action in CVS menu. 

  ------------------- Workdir Manager -----------------+
  |                                        |           |
  | Workdir          | CVSRoot             |  [Add]    |
  | C:\cvss\wodo     | server:/path        |  [Remove] |
  | D:\go\now        | :local:c:\repo      |  [Change] |
  |                                                    |
  +----------------------------------------------------+

where [Change] opens:

  --- Change CVS Root  ------+
  | Workdir: ______________  |
  | Root:    _____________v  |
  |        [Switch] [Cancel] |
  +--------------------------+

where [Switch] shows confirmation dialog and if confirmed it changes all
CVS/Root in given workdir.

Is it acceptable? Are you able to code such mini module?
Comment 9 misterm 2005-10-08 03:47:11 UTC
Created attachment 25698 [details]
Initial module code
Comment 10 misterm 2005-10-08 03:52:43 UTC
I've just attached code for a module that implements a slightly different idea 
than the one proposed here before. It works from the CVS menu (not the popup 
menu) when a Node that represents a folder under version control is selected. 
User input is not validated in this version (empty/invalid).

Note that one thing that might look like a bug is not: even if the CVS Root 
string hasn't changed, the module should overwrite it since some nested folders 
might contain a different CVS Root sometimes.

If you want to integrate a modified version of this code to NetBeans, please 
let me know so we can discuss copyright issues.
Comment 11 _ pkuzel 2005-10-10 16:45:27 UTC
It can not be opened. I filed issue #66394. I'll try again later.

Regarding copyright it's up to you. If you want to use NetBeans.org distribution
channels and CVS you must share rights, sign CA. Otherwise just check if you do
not violate SPL (in case of new code almost certainly OK).
<http://www.netbeans.org/about/legal/approved-contributors.html>
Comment 12 _ pkuzel 2005-10-10 16:47:29 UTC
Typo, correct is issue #66404.
Comment 13 misterm 2005-10-10 21:39:17 UTC
Created attachment 25773 [details]
Initial module code, with problems fixed. Should open now.
Comment 14 misterm 2005-10-10 21:41:36 UTC
>------- Additional comments from pkuzel Mon Oct 10 15:45:27 +0000 2005 ------

> It can not be opened. I filed issue #66394. I'll try again later.

I've uploaded a new version that should work.

> Regarding copyright it's up to you. If you want to use NetBeans.org 
> distribution channels and CVS you must share rights, sign CA. 

I guess there are no problems with this option. Please let me know what you 
think of the code I've submitted.
Comment 15 _ pkuzel 2005-10-11 10:23:25 UTC
Thanks, it opens now.

  - I'm not sure if FileSystem atomic operation scales. I'd use java.io.File
    access. AFAIK, no need to keep IDE in sync, here. And it's way faster.
  
  - From usability point of view I'd use combo showing last 8 values.

  - I would replace getFile() with something more generic that would
    work on Project context too. See 
       Context ...cvss.util.Utils.getContext()
       - or better -
       AddToRepositoryAction.java that is enabled on 'atomic' contexts
    Right now just copy paste the code.

  - I would cut down cvss dependency. I guess that CVS/Root existence test
    should be enough.

  - use just one progress, indertemite can change to determinite at runtime.

To sum up it looks very promising.
Comment 16 misterm 2005-10-12 18:16:34 UTC
I will revise the patch in a few days if no one implements your suggestions.
Comment 17 misterm 2005-10-13 15:51:28 UTC
Changing to ENHANCEMENT so it shows up in the dashboard list.
Comment 18 misterm 2005-10-18 19:33:27 UTC
Created attachment 26099 [details]
Reworked version of the module
Comment 19 misterm 2005-10-18 19:48:15 UTC
> ------- Additional comments from pkuzel Tue Oct 11 09:23:25 +0000 2005 -------
>  - I'm not sure if FileSystem atomic operation scales. I'd use java.io.File
>    access. AFAIK, no need to keep IDE in sync, here. And it's way faster.

Implemented.
  
>  - From usability point of view I'd use combo showing last 8 values.

Well, I have to leave you some work :-) Actually, I didn't have time to 
implement it and I'm not sure when I'll be able to do it.

>  - I would replace getFile() with something more generic that would
>    work on Project context too. See 
>       Context ...cvss.util.Utils.getContext()
>       - or better -
>       AddToRepositoryAction.java that is enabled on 'atomic' contexts
>    Right now just copy paste the code.

I originally copied the code from AddToRepositoryAction.java, but it is 
_broken_. If you have a free-form project, even selecting the node for your 
sources in the Files window will return the directory containing the nbproject 
folder, which is not the correct behaviour.

I've changed the order it looks for the File instance - first tries to treat as 
DataObject, then treat it as a Project - and I've also changed the logic for 
obtaining the root directory when there is actually a project. Now it works for 
free-form projects. I guess the same fix should be applied to 
AddToRepositoryAction.

>  - I would cut down cvss dependency. I guess that CVS/Root existence test
>    should be enough.

Implemented.

>  - use just one progress, indertemite can change to determinite at runtime.

Implemented in a somewhat different way, by using the first 50% for the 
scanning process and the rest for the rewriting process itself.

Not sure I will have time to touch this code anytime soon, so, if there is 
anything you would like to change, I will probably will not be able to. It's 
better you propose any further changes here but implement it yourself, if 
possible.
Comment 20 _ pkuzel 2005-10-24 08:48:53 UTC
I'm under presure of high priority bugs now.
Comment 21 _ pkuzel 2005-11-14 13:33:32 UTC
Jack, I'm waiting for Mustang's CA and NetBeans CA signers merging.
Comment 22 _ pkuzel 2005-11-21 13:50:22 UTC
In light of issue #68881 the code should be improved to recalculate
CVS/Repository files (using absolute path format) too.
Comment 23 jcatchpoole 2005-11-28 16:24:21 UTC
Not sure if you are still waitinng on this, but other Sun project CA signatories
are listed here : http://www.sunsource.net/CA_signatories.  If the contributor
is listed there we can accept contributions.  NB signatories are listed on
nb.org (http://www.netbeans.org/about/legal/approved-contributors.html), though
that will probably move to sunsource.net soon.
Comment 24 misterm 2005-11-28 16:48:48 UTC
And, thanks God, my name is listed there:

Michael Nascimento Santos - JDK javanet - mister__m
Comment 25 _ pkuzel 2005-11-29 13:36:18 UTC
Michael, is the module still required? Or time proved that you (and others)
could live without it?

If still requied I'll put it under javacvs/util_switcher.
Comment 26 misterm 2005-11-29 13:40:27 UTC
Yes, it is (and I've personally used it a lot and it is easy to track since I 
need to reinstall it every time I switch to a new NB build), for the following 
two use cases:

1. Working from inside the customer network and outside (different CVSROOTs);
2. Working with configurations that use symbolic links (java.net and NetBeans). 
You only realize you need to change the CVSROOT once Search history fails. By 
the time it happens, you probably have worked a lot and modified several files.
Comment 27 _ pkuzel 2005-11-29 14:00:35 UTC
Thanks, it looks still actual.
Comment 28 _ pkuzel 2005-11-29 14:56:05 UTC
RCS file:
/shared/data/ccvs/repository/javacvs/util_switcher/nbproject/platform.properties,v
done
Checking in nbproject/platform.properties;
/shared/data/ccvs/repository/javacvs/util_switcher/nbproject/platform.properties,v
 <--  platform.properties
initial revision: 1.1
done
RCS file:
/shared/data/ccvs/repository/javacvs/util_switcher/nbproject/project.properties,v
done
Checking in nbproject/project.properties;
/shared/data/ccvs/repository/javacvs/util_switcher/nbproject/project.properties,v
 <--  project.properties
initial revision: 1.1
done
RCS file:
/shared/data/ccvs/repository/javacvs/util_switcher/nbproject/genfiles.properties,v
done
Checking in nbproject/genfiles.properties;
/shared/data/ccvs/repository/javacvs/util_switcher/nbproject/genfiles.properties,v
 <--  genfiles.properties
initial revision: 1.1
done
RCS file: /shared/data/ccvs/repository/javacvs/util_switcher/nbproject/.cvsignore,v
done
Checking in nbproject/.cvsignore;
/shared/data/ccvs/repository/javacvs/util_switcher/nbproject/.cvsignore,v  <-- 
.cvsignore
initial revision: 1.1
done
RCS file:
/shared/data/ccvs/repository/javacvs/util_switcher/nbproject/build-impl.xml,v
done
Checking in nbproject/build-impl.xml;
/shared/data/ccvs/repository/javacvs/util_switcher/nbproject/build-impl.xml,v 
<--  build-impl.xml
initial revision: 1.1
done
RCS file: /shared/data/ccvs/repository/javacvs/util_switcher/nbproject/project.xml,v
done
Checking in nbproject/project.xml;
/shared/data/ccvs/repository/javacvs/util_switcher/nbproject/project.xml,v  <--
 project.xml
initial revision: 1.1
done
RCS file: /shared/data/ccvs/repository/javacvs/util_switcher/manifest.mf,v
done
Checking in manifest.mf;
/shared/data/ccvs/repository/javacvs/util_switcher/manifest.mf,v  <--  manifest.mf
initial revision: 1.1
done
RCS file: /shared/data/ccvs/repository/javacvs/util_switcher/build.xml,v
done
Checking in build.xml;
/shared/data/ccvs/repository/javacvs/util_switcher/build.xml,v  <--  build.xml
initial revision: 1.1
done
RCS file: /shared/data/ccvs/repository/javacvs/util_switcher/.cvsignore,v
done
Checking in .cvsignore;
/shared/data/ccvs/repository/javacvs/util_switcher/.cvsignore,v  <--  .cvsignore
initial revision: 1.1
done
RCS file:
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/resources/mf-layer.xml,v
done
Checking in src/net/java/dev/cvsrootselector/resources/mf-layer.xml;
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/resources/mf-layer.xml,v
 <--  mf-layer.xml
initial revision: 1.1
done
RCS file:
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/resources/Bundle.properties,v
done
Checking in src/net/java/dev/cvsrootselector/resources/Bundle.properties;
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/resources/Bundle.properties,v
 <--  Bundle.properties
initial revision: 1.1
done
RCS file:
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/CvsRootSelectorAction.java,v
done
Checking in src/net/java/dev/cvsrootselector/CvsRootSelectorAction.java;
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/CvsRootSelectorAction.java,v
 <--  CvsRootSelectorAction.java
initial revision: 1.1
done
RCS file:
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/CvsRootSelectorPanel.form,v
done
Checking in src/net/java/dev/cvsrootselector/CvsRootSelectorPanel.form;
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/CvsRootSelectorPanel.form,v
 <--  CvsRootSelectorPanel.form
initial revision: 1.1
done
RCS file:
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/CvsRootRewriter.java,v
done
Checking in src/net/java/dev/cvsrootselector/CvsRootRewriter.java;
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/CvsRootRewriter.java,v
 <--  CvsRootRewriter.java
initial revision: 1.1
done
RCS file:
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/CvsRootSelectorPanel.java,v
done
Checking in src/net/java/dev/cvsrootselector/CvsRootSelectorPanel.java;
/shared/data/ccvs/repository/javacvs/util_switcher/src/net/java/dev/cvsrootselector/CvsRootSelectorPanel.java,v
 <--  CvsRootSelectorPanel.java
initial revision: 1.1
done
Comment 29 _ pkuzel 2005-11-29 14:58:56 UTC
Robert, I'd like to export this module (send by private email) to NetBeans 5.0
Development and Beta AUC.
Comment 30 rbalada 2005-11-29 16:06:59 UTC
Dev UC is handled by daily-alpha-nbms moduleconfig in nbbuild/build.properties
on trunk. Just add 'javacvs/util_switcher' to the list of modules.

Comment 31 _ pkuzel 2005-11-29 16:17:44 UTC
Checking in build.properties;
/shared/data/ccvs/repository/nbbuild/build.properties,v  <--  build.properties
new revision: 1.348; previous revision: 1.347
done
Comment 32 _ pkuzel 2005-11-29 16:50:27 UTC
To Michael: it's on daily AUC. You can register it for Beta AUC using
<http://www.netbeans.org/community/guidelines/au-request-form.html> form.

<http://www.netbeans.org/community/guidelines/au-management.html#Add%20Steps>.