ClearCase : new package check in error

Hi all,

When I create a new package in IDEA and then I try to Check In the Project, the plug-in does not seem to be able to add the directory to Clearcase.
(error: directory already exists)

Is it a known limitation ? Can it be solved or should I manually add the package with add command from the IDEA clearcase context menu?

Furthermore, sometimes the new created folder does not appear at all into the Check In project dialog. (mainly when the folder is empty)

Thank you for your help,

Cedric

17 comments

"cedlux" <cedric_rochet@yahoo.fr> wrote in message
news:9905727.1045571637645.JavaMail.jrun@is.intellij.net...

Hi all,

>

When I create a new package in IDEA and then I try to Check In the

Project, the plug-in does not seem to be able to add the directory to
Clearcase.

(error: directory already exists)

>

Is it a known limitation ? Can it be solved or should I manually add the

package with add command from the IDEA clearcase context menu?
No it isn't a known limitation. To diagnose this I need to have a little bit
more contextual info:
Are you using the commandline or the native implementation?
Could you follow the steps outlined in
http://www.intellij.org/twiki/bin/view/Main/ClearcasePluginManual#Troublesho
oting and send me the log file following one of these error?

>

Furthermore, sometimes the new created folder does not appear at all into

the Check In project dialog. (mainly when the folder is empty)
I am not sure what IDEA sends to the plugin but if it doesn't appear at all
in the dual tree view of the Check In project dialog IDEA is not going to
send it to the plugin. There is not a lot I can do. I suggest you file a
request for this and post the link on this thread.

Jacques
>

Thank you for your help,

>

Cedric



0

Jacques,

I'm having the same problem. Let's forget about Idea for a moment. In Clearcase, when I need to create a new package/directory in my view, I need to issue the 'ct mkdir' command, not just a plain 'mkdir' command (I'm using Unix). I also need to checkout the parent directory of the new directory first.

Now - back to your plugin and Idea. If I right click on a directory or package and select New Directory/Package, the new directory is created by Idea. The problem is that this is bad. Clearcase has not been used to make the directory. If I right click on the new directory and select Clearcase|Add - I get an error from the plugin because it is calling mkelem on the directory (I'm using commandline version of plugin).

Am I using the plugin wrong? Does the plugin support this? I'd appreciate some help here.

Thanks,
Rick

0

What error do you get?
I tested the command line "mkdir testdir;cleartool co -nc .;cleartool mkelem -nc testdir" on both solaris 8 with clearcase 5.0 and Win2K clearcase 4.2 and 5.0. In all cases it works. Can you try as well and let me know if you get a problem?

Also give me your IDEA log and configuration (OS version, clearcase version, IDEA version, plugin version...)

Thanks

Jacques

0

Sorry I did not answer your question:
It is by design that when you create a directory it doesn't use cleartool to do it. First there isn't a way in IDEA to do that. Secondly the current VCS API allows to batch up all VCS actions until you check in the project or invoke the Add action explictly. Add/Remove/Move/Rename of file/directories do not impact Clearcase until you check in the project. The only thing that affects immediately clearcase is the checkout on edit. In that respect it isn't very consistent. So I am about to put an option to not do the checkout on edit but instead hijack the file and then have the checkout/undo hijacked done at check in time so you will be able to work offline until you are ready to checkin the project.

Does it make sense?

Jacques

PS: BTW In my other post, I only used snapshot views. Are you using dynamic views?

0

Hey Jacques,
I am working with Rick and have some information for you.

ClearCase version 2002.05.00 (Wed Jan 30 13:23:18 EST 2002)
clearcase_p2002.05.00-23 (Fri May 23 07:50:42 EDT 2003)
clearcase_p2002.05.00-24 (Tue May 27 06:59:23 EDT 2003)
Linux lpc6308l 2.4.20-18.9 #1 Thu May 29 07:08:16 EDT 2003 i686 i686 i386 GNU/Linux
IDEA 3.0.4 with plugin for clearcase release 1.21.
We are using dynamic views and not snapshots.

mkdir timtest
ct co .
ct mkelem -nc timtest
cleartool: Error: Can't create directory element because "timtest" already exists.

I am attaching the log file as well.
Thanks for your help!
Tim



Attachment(s):
idea.log
0

The only problem I saw in your log file, is that you are using the native implementation. This implementation is only available on Windows. Choose the CommandLine implementation instead.

As far as the check in error, how on linux do you add a directory? I need the sequence of steps to do it.
BTW do you have any problem adding a file?

Jacques

0

Jacques,

I am using your ClearCase plugin with IntelliJ 3.0.5 (build #706) on Linux RedHat 9.0.

After giving up on using ClearCase dynamic views (your plugin can't work dynamic view) we created a snapshot view and things are working better to a point.

I started with an empty snapshot view and created a new directory and a new file in the directory using Idea. I then selected the "Check In Project" menu and received a few errors.

For the log:

2003-10-06 14:19:34,257 DEBUG - ansparent.CommandLineClearCase - cleartool ci -comment "Added foo.txt" -identical /net/greyfell/Rational/viewstore/rmaddy_idea/vobs/JeppSrcTest/lib
2003-10-06 14:19:34,257 DEBUG - ansparent.CommandLineClearCase - cleartool ci -comment "Added foo.txt" -identical /net/greyfell/Rational/viewstore/rmaddy_idea/vobs/JeppSrcTest/lib
2003-10-06 14:19:34,697 DEBUG - rge.transparent.TransparentVcs -
net.sourceforge.transparent.ClearCaseException: Error executing cleartool ci -comment "Added foo.txt" -identical /net/greyfell/Rational/viewstore/rmaddy_idea/vobs/JeppSrcTest/lib : cleartool: Error: Element name not found: "foo.txt"".
cleartool: Error: Element name not found: "-identical".
Making dir "vobs/JeppSrcTest/lib".
Checked in "/net/greyfell/Rational/viewstore/rmaddy_idea/vobs/JeppSrcTest/lib" version "/main/2".
at net.sourceforge.transparent.Runner.run(Runner.java:60)
at net.sourceforge.transparent.CommandLineClearCase.cleartool(CommandLineClearCase.java:72)
at net.sourceforge.transparent.CommandLineClearCase.checkIn(CommandLineClearCase.java:23)
at net.sourceforge.transparent.ClearCaseDecorator.checkIn(ClearCaseDecorator.java:51)
at net.sourceforge.transparent.ClearCaseFile.checkIn(ClearCaseFile.java:93)
at net.sourceforge.transparent.ClearCaseFile.add(ClearCaseFile.java:128)
at net.sourceforge.transparent.TransparentVcs.addFile(TransparentVcs.java:194)

The problem is obvious - you are creating the 'cleartool' command line, wrapping the comment in quotes. While this command line will work fine from the command line under unix, the Runtime.exec() call in Java parses the command line string on whitespace.

In the end all the files are created and checked in but you get the above error. If I look at the history of the new directory, the command is '"Added' (without the single quotes.

You need to find a different way to call exec with the correct parameters. Probably the easiest way would be to use the 'exec' that takes a String array instead of a string. You can then pass the correct array of string arguments and not rely on the default StringTokenizer breaking up the full command on whitespace.

To reproduce this problem, setup your project to use the command line version of the plugin.

Make a simple directory, create a dummy file in the new directory.

Check in the project - you will get the error.

Thanks,
Rick

0

I can't promise a release for Ariadna soon. Too much work going on right now.
Let me know if it is something that prevents you from working and I will try to do something quickly.

BTW what doesn't work with Dynamic view?

Jacques

0

"Let me know if it is something that prevents you from working and I will try to do something quickly"

The current state of the plugin makes is completely unusable. I will get an error during project checkin for every file/directory I create/modify. Every comment will be wrong for every new directory.

Am I missing something? From my point of view I don't see how anyone can be using your plugin at all. I'm sure others are using it so hopefully it's my mistake. Any ideas?

"BTW what doesn't work with Dynamic view?"

Creating of directories doesn't work with dynamic views. It's clearly stated in the ClearCase documentation that in a dynamic view, you can't convert of view private directory into an element using the mkelem command. You have to jump through a bunch of hoops with some sort of import. Here is an excerpt:

"Converting View-Private Directories

You cannot create a directory element with the same name as an existing view-private file or directory, and you cannot use mkdir to convert an existing view-private directory structure into directory and file elements. To accomplish this task, use the clearexport_ffile and clearimport utilities."

Thanks,
Rick

0

Let's just drop Clearcase. I HATE IT!!!!

Let me see what I can do. No promise however. I am swamped right now with work. Can you help? This involves to just fix the clearcase commandline interface which is completely separated from IDEA environment.

Jacques

0

>Let's just drop Clearcase. I HATE IT!!!!

eh, I hate it too, in fact, all my co-workers hate it too. And still we all work use it - pathetic...

0

If you send me the plugin source code for Idea 3.0.5 I will take a whack at it. I just need Runner.java and CommandLineClearCase.java. I gues you can attach them to this thread or add them to the Wiki at intellij.org

The Wiki only has the EAP source code.

Rick

0

The Wiki only has the EAP source code.


This is the directly link http://www.intellij.org/twiki/bin/viewfile/Main/ClearcasePlugin?rev=1.1&filename=transparent-src.zip

TWiki keeps revision of all attachments. Instead of clicking on the name (in the "Attachements" column) click on the "Action" column in the row of the file you want. The second table of the resulting page is the revision table. You can then retrieve any one of them.

Hope this was clear enough ;)

Jacques

0

I should have fixed both problems that you mentioned in the latest build 1.26. Unfortunately I do not have the time to backport it to Ariadna.
Could you try Aurora (http://www.intellij.net/eap ) and the latest version of the plugin and tell me if they are fixed?

Thanks

Jacques

0

the scheme we've come up with for importing view-private directories goes something like:

1) rename the directory. something like "mv foo foo.old".
2) make the new clearcase element: "cleartool mkdir foo"
3) move evertyhing in: "mv foo.old/* foo"
4) recurse steps 1-3 on foo/*
5) delete foo.old

yes, it's pretty lame, but you have to have clearcase admin privileges to use their import tools (it prompts for the admin password), at least in version 4. most users probably won't have this.

i can probably send you the script we use to automate this if you want it.

hth
-j

ps

some background: we run clearcase on solaris, but i use the plugin from IDEA on windows to access my unix-served dynamic views. it works quite well for me, with the exception that i "mkelem" all new files/directories from the unix command line, not via the plugin. i also have to do a little manual intervention when renaming classes.

thanks a ton for the work on the plugin though; i couldn't use idea (easily) without it. the ability to check out files through idea is by far the most important feature, and it's always worked great for me. seems like most feedback around here is unduly negative...

0

This is the exact behavior implemented already in 1.26.
Unfortunately that version is only available for Aurora

Jacques

0

Please sign in to leave a comment.