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 61782 - Use CVS add, not CVS import
Summary: Use CVS add, not CVS import
Status: REOPENED
Alias: None
Product: versioncontrol
Classification: Unclassified
Component: CVS (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@versioncontrol
URL:
Keywords:
: 65668 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-08-03 22:19 UTC by _ tboudreau
Modified: 2007-01-04 17:14 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description _ tboudreau 2005-08-03 22:19:50 UTC
(intending to file this against the new cvs support - where is it?)

From Jesse:
> Tim do you think you could avoid using cvs import? It's kind of annoying 
> because the initial versions of every file is 1.1.1.1 rather than 1.1, 
> and SourceCast doesn't display the initial files when you commit them.
> 
> Just cvs add and cvs ci works fine.

It looks like the new CVS support does not play nicely with NetBeans CVS.  Is it
possible to set it up to use add, instead of import?
Comment 1 Jesse Glick 2005-08-03 22:36:02 UTC
cvslite bugs go in the javacvs component last I checked.

Tim you probably want to give some information about how to reproduce this. I
add directories with new files using cvslite all the time and it works fine.
(Simply make a dir and a file in it, and later commit - cvslite is smart enough
to add the dirs first.) It is only you who has been importing. So what did you
do different?
Comment 2 _ tboudreau 2005-08-04 00:53:39 UTC
Create a new project and choose Import into Repository (it does what it says,
the question is whether it's the right thing...)
Comment 3 Jesse Glick 2005-08-04 02:24:00 UTC
How do you even get that option? If I create a new j2se main app in /tmp, there
are no interesting options in the CVS menu. If I create it directly inside
.../nb_all, it just has "Commit Project...".

Ah, now I think I see. Create a new j2se main app under .../nb_all/contrib and
select its root node. The main CVS menu in the IDE has various menu items;
"Commit Project" is there and AFAIK does exactly what you want. There is no
"Import". However the context menu of the project root node has a CVS submenu
with only one item: "Import Project into Repository".

I'm not sure why this is only in the context menu, and why the normal CVS
operations are not in the context menu for this new project. Nor am I sure why
you would ever want to use "Import..." when you could just use "Commit...",
which works fine last I checked (adds the dirs and files and commits them).

There is a "cvs import" command, but it is mainly useful for importing external
sources using a vendor branch. If you don't know what that means, consider
yourself lucky - it's a rather confusing and hairy system, present only in CVS I
think, for solving a special case of the general merge tracking problem. Since I
doubt cvslite actually supports vendor branches the way they were intended to be
used (would require some interesting GUI), it is probably best to never run this
command at all, at least IMHO.

That said, there may be special issues involved in adding dirs to the top of the
CVS repository. This would never come up for netbeans.org CVS, since all
top-level dirs have to be created in SourceCast by using the project admin
feature. However in a vanilla CVS server installation it could be tricky to
first make a *top-level* module. (Not like .../nb_all/contrib/whatever, which is
a second-level dir.) In my experiments it works to "cvs co -d whatever -l ."
which gives you an empty CVS working directory corresponding to the top of the
repo, to which you can then add dirs and it is fine, but perhaps this doesn't
work under certain setups - I just don't know.

More info:

1. Run

cvs -d /tmp/cvsrepo init
pushd /tmp
cvs -d /tmp/cvsrepo co -d work -l .

2. Make a new j2seproject in /tmp/wd/one.

3. Select its root node and choose CVS -> Commit from main menu.

4. /tmp/cvsrepo/one is created and the correct files are committed as expected,
as 1.1.

5. Now make a j2seproject in /tmp/wd/two.

6. From its context menu, choose CVS -> Import.

7. An "Import Project Options" dialog appears. Looks quite scary. But for me the
OK button is always disabled, so I don't know how to continue.

Personally I would recommend never using Import, and perhaps deleting it from
the GUI altogether, but perhaps there is some use case I am not aware of which
requires it.
Comment 4 _ pkuzel 2005-08-18 15:09:43 UTC
I'm surprised that "cvs add" works at root level. Probably given by "checkout ."
that creates root level CVS folder. Having problems to get root level CVS folder
I concluded import is the only way.

Hopefully users should not spot that cvs import is used under hood if they
choose checkout after import checkbox.

Comment 5 Jesse Glick 2005-08-18 16:00:27 UTC
Yes, "cvs co ." creates a root-level CVS folder, which at least in my simple
test on Linux works just like any other CVS folder. CVS/Repository says "." as
you might expect. (It is also possible to have a phony top-level working dir
using CVSROOT/Emptydir, but you cannot add to this, only check out existing
repository dirs.)

Use of "cvs import" rather than "cvs add" is visible in at least these ways:

- creation of odd rev numbers "1.1.1.1"

- need for an esoteric "vendor branch"

- does not create a working directory, so you have to delete your existing files
(including any build products, local backups, ...) and check out a fresh copy
for no apparent reason

As I mentioned, I can't fully evaluate the GUI since the OK button was always
disabled for me in the Import dialog and I couldn't figure out how to get it
enabled.
Comment 6 _ tboudreau 2005-08-19 05:12:04 UTC
> I'm surprised that "cvs add" works at root level.

contrib/ is not root level, but when I add a project there, the UI only gives me
the option of Import;  it sounds like you're assuming that adding a project to
CVS always means adding it at root level.
Comment 7 Jesse Glick 2005-08-19 05:21:05 UTC
As I pointed out before, "Import" is only in the context menu in this case,
whereas "Add" is present in the main menu and works. This looks like a bug.
Comment 8 Maros Sandor 2005-09-26 16:07:35 UTC
This was probably related to issues #64109 and #64282. Both has been fixed so I
assume this is no longer an issue.
Comment 9 _ pkuzel 2005-10-03 15:03:08 UTC
From mail:

>This brings up a few wider questions:
>
>- if a file is mistakenly added into CVS, how can I remove it without
>deleting it on my disk?
>
>- how do I add a file like Hello.class which CVS thinks users usually
>don't want to version control?  We have bunch of *.class files in CVS
>under **/test ourselves
>
>- another use case why it's remove without deleting is needed is when a
>file is added to CVS as text but it should be binary.  One has to remove
>and readd with -kb.  This is how CVS works.
>
Import Wizard could ask user for all this data ahead. But it
would become monster wizard,

Recently I thought about importing a top level directory only
and leaving rest of 'import' on first commit of all "Locally
added" files. User could correct all defaults before commiting.
Comment 10 _ pkuzel 2005-10-04 10:03:04 UTC
*** Issue 65668 has been marked as a duplicate of this issue. ***
Comment 11 _ pkuzel 2005-10-04 10:05:43 UTC
Yet another user failed into this trap.
Comment 12 Maros Sandor 2005-11-14 13:12:49 UTC
We mimic import command of CVS command line client. In the future we may rewrite
the "Import" action so that it does not run the import command but adds all
files manually. In the meantime, I would recommend importing only a placeholder
file and add/commit all others.