Clearcase plugin

For information, i bring on the forum a conversation i had with Michael Gerasimov (who is in charge of the clearcase plugin)

I see many issues with the way changelists work now in relation to activities :

1 - what happens if 2 activities have the same headline in CC but in different views (i've told you about this in my precedent message)
2 - At which level do the changelist currently work ? If you create a changelist in IntelliJ, nothing is done in CC, which is bad from my point of view.
3 - Obsolete & locked activities. How to see them and mark/unmark them obsolete (you seem to have fixed this in 7.x, nice) ?

Here is my proposal, with a small scenario that i came up with :

1 - No changelist, no activity, fresh new project, with moduleA, moduleB, moduleC each in a different UCM view, UCM mode on in IntelliJ.

2 - I want to fix a bug that involves changing files in moduleA and moduleB. Ideally i would like to view this as a single changlist in IntelliJ. But that means 2 CC activities, because moduleA is in a different view than moduleB.

3 - I navigate to a file of moduleA, let's say FileA.java, i type a keystroke, and IntelliJ pops up a dialog asking me how i want to "clear the read-only status", using filesystem or using version control integration. At that point, still no activity has been created in CC. In current IntelliJ version, if you select the latter option (using VCS), you'll get an error message saying that no activity is set in view. I think this is the best time to ask for the creation of a changelist, and at the same time the creation of a CC activity which will be created in the view where FileA.java is located and whose name will be the same as the changelist. (note : it works that way in Ecplise, it pops up the native CC activity creation window).

4 - So i create a new changelist 'Fixed hard to find bug', IntelliJ detects that there is no activity in ModuleA's view and asks me to create one, with the name 'Fixed hard to find bug'.

5 - All right, i've made my fix in FileA.java. Now i want to fix FileB.java which is in moduleB which is in some other view. I have this changelist 'Fixed hard to find bug', but it's associated to an activity in ModuleA. The problem is that i'd like very much to see FileB.java in that changelist, to be able to commit those related changes in one step. You have two design options : either one changelist matches one activity (which means only one view), or one changelist can have many activities associated to it, but in that case you should restrict to the ones that have exactly the same name. Now suppose you choose to do so in IntelliJ, i'll be able to see FileA and FileB both in my changelist, and have 'Fixed hard to find bug' CC activity created in moduleA's view and an activity with the same name in ModuleB's view.

6 - I can now commit my changes. So i choose my changelist and press the 'commit changes' button. The checkout files are now checkin and IntelliJ should propose me to obsolete the underlying CC activities.

Even with this system, i see some issues :
1 - What happens if i mark in CC the activity 'Fixed hard to find bug' in viewA as obsolete, but not the other ?
2 - What if i rename in CC one of the activities ? Intellij should detect that and show 2 changelists with the correct checked out files under each.
3 - If you move files from a changelist to a new activity, you have to create in CC all needed activities.
4 - What happens if you rename changelists (i think you should rename automatically CCactivites)

To conclude, as i see things, in UCM mode, a changelist in IntelliJ is just a mirror of an activity in CC, for base clearcase, that's ok : changelist just are just 'organized' comments.
If you have many CC activities with the same name, group them under a unique changelist. Maybe that should be an option, some people may prefer to have a 1-1 relationship (you could provide a button like 'group identical activities') . As an alternative, create a new concept : group of changelists, just like you came up with group of modules sometimes ago, but it complicated things and it won't make sense probably with regards to other CVS systems.

Hope this helps, don't hesitate to ask me questions, i'm available and i'll be glad to answer.

11 comments

His answer :

Hi, Gilles,

Sorry for the silence, my child was ill a little bit and I had no possibility to keep a
hand on a pulse...
So, to keep things fast:

1 - what happens if 2 activities have the same headline in CC
but in different views (i've told you about this in my precedent message)


If they have an equal internal name (most often it is the same name with underscores
instead of blanks) then nothing criminal will happen.

2 - At which level do the changelist currently work ? If you create a changelist in

IntelliJ, nothing is done in CC, which

is bad from my point of view.


This is a good question. From the very beginning we considered that activities should not
be treated as first-class objects in IDEA, that is we don't create/delete them, just take
them into consideration while processing most major commands like check in and check out.
Thus change lists were just an activities mapped upon the IDEA start. But when we allowed
users to move changes across changelists here comes the problem of proper processing of
checkin command. So, right now the policy is the following: allow to create new change
list, allow to move changes into it, check in files as usual, create new activity
corresponding to this changelist right after the checkin, and move the last version of the
checked in files into the newly created activity. If you have an access to the plugin's
source code you can see the plugin performing the following after the checking in:

"mkact", "-nc", "-f", "-headline", "\"" + dstActivity + "\"", dstActivityNorm.

At first I suppose that the more this process is transparent the better. However, users
want to have a greater control over the activities during the IDEA session (like you :)).

3 - Obsolete & locked activities. How to see them and
mark/unmark them obsolete (you seem to have fixed this in 7.x, nice) ?


I can now recognize obsolete activities (well, locked ones are similar in processing) but
I have no means (in the core) to properly highlight/format them. Neither I have means to
overload some logic behind the changelists operations (like block the movement of changes
into the obsolete changelist/activity).


Here is my proposal, with a small scenario that i came up with :

error message saying that no activity is set in view. I think
this is the best time to ask for the creation of a
changelist, and at the same time the creation of a CC
activity which will be created in the view where FileA.java
is located and whose name will be the same as the changelist.


Agreed.


4 - So i create a new changelist 'Fixed hard to find bug',
IntelliJ detects that there is no activity in ModuleA's view
and asks me to create one, with the name 'Fixed hard to find bug'.


Is that prompting really necessary? Why not to treat changelist as an activity and create
it silently upon checking in? At least the fact that a user created an activity which
changes are put in is the hint that user wants something different from the default.
Additionally, even if it is the first IDEA session but there are some activities already
set on the project, these activities will automatically appear in the Changes View, this
will help user to understand the nature of changelists in UCM mode.

exactly the same name. Now suppose you choose to do so in
IntelliJ, i'll be able to see FileA and FileB both in my
changelist, and have 'Fixed hard to find bug' CC activity
created in moduleA's view and an activity with the same name
in ModuleB's view.


I just need to check the current behavior. This is quite easy to implement.

and press the 'commit changes' button. The checkout files are
now checkin and IntelliJ should propose me to obsolete the
underlying CC activities.


Agreed, "obsoleting" action will appear as an option in the Commit Files dialog.

1 - What happens if i mark in CC the activity 'Fixed hard to
find bug' in viewA as obsolete, but not the other ?


I suppose I need to obsolete the activity for all views it participates in.

2 - What if i rename in CC one of the activities ? Intellij
should detect that and show 2 changelists with the correct
checked out files under each.


This is an arguable statement. Please keep in mind that all synchronizations are the
costly calls to "cleartool". This means that I perform such calls as rarely as possibly.
The synching you talk about must be performed on focus-lost-focus-get basis. From the
other side, renaming of the activity is so rare action that all my activity synching will
be just a waste of resources. I thing that current synch implementation with "Version
Control | Synchronize activities" menu item is a proper trade off. Anyway this is a good
topic and if someone can suggest a smarter decision I'' definitely say "thanx".

3 - If you move files from a changelist to a new activity,
you have to create in CC all needed activities.


No problems right now.

4 - What happens if you rename changelists (i think you
should rename automatically CCactivites)


If it is a new activity - no changes, if the existing one - ok.

under a unique changelist. Maybe that should be an option,
some people may prefer to have a 1-1 relationship (you could
provide a button like 'group identical activities') . As an


I like this "group identical", but again, seems that I have to wait some core-side
response (I've already put a proposal for this).

Note : maybe we should have this conversation on the forum,
as some people might be interested in providing their input ?


Yes, public discussion proved to be fruitful (unless there are several hundred
participants :-)...).

Best wishes, thanx for extremely productive proposals.

Michael Gerasimov,
JetBrains, Inc
http://www.jetbrains.com
"Develop with pleasure!"

0

Hello Michael,

I've downloaded #7531 to be able to use the brand new UCM mode per module stuff, and hence to see CC activities treated as changelists.

Here is the list of issues :
- after i enable UCM mode in settings, i have to manually hit the "Synchronize Activities" menu to see the corresponding changelists in IntelliJ, maybe that should be automatic
- i must not see activities from other users, because i'm never supposed to work on other people activities (should add -me option to cleartool lsact)
- Suppose i have 2 CC activities (Activity1 and Activity2), Activity1 being active in my CC view. I now select Activity2 changelist in IntelliJ and click "Set Active Changelist" button. If i checkout a file, it doesn't appear in Activity2 but in Activity1 (the active CC activity, but not the active IntelliJ changelist), is that the expected behaviour ?

On a side note, where are located the clearcase plugin sources ?

Gilles

0

Thank you, Gilles, for opening a very useful conversation.

In addition I'd like to discuss the following issues related to the activities
emulation.

1. Can I safely restrict the set of activities to the ones created by the
current user only? I know that is it "theoretically possible" to assign someone's
activity to the user's view, at least CCase does not prohibit that.

2. While "obsoleting" activity is a well-defined scenario, not everyone uses
it. Thus user can see a lot of changelists corresponding to numerous empty
activities from the past work. That is - can I remove empty changlists from
the overall list? Or should I parameterize this behavior (though I personally
don't prefer to invent an option for each particular deviation)?

best wishes,
Michael Gerasimov,
Software Developer
JetBrains, Inc


0

>1. Can I safely restrict the set of activities to the ones created by the
>current user only? I know that is it "theoretically possible" to assign someone's
>activity to the user's view, at least CCase does not prohibit that.

I checked with our CC admin, he told me that an activity is for a user / stream combination, so a different user can't use (read : checkout in...) another user's activity.

>2. While "obsoleting" activity is a well-defined scenario, not everyone uses
>it. Thus user can see a lot of changelists corresponding to numerous empty
>activities from the past work. That is - can I remove empty changlists from
>the overall list? Or should I parameterize this behavior (though I personally
>don't prefer to invent an option for each particular deviation)?

Obsolete <> empty, you can have a newly created CC activity with no checkout. Obsolete means : i don't want to see this activity anymore in Clearcase explorer.
So don't remove empty changelists, i'm ok if you don't want to show obsolete ones.

Gilles

0

Dear Gilles,

>> 1. Can I safely restrict the set of activities to the ones created by
>> the
>> current user only? I know that is it "theoretically possible" to
>> assign someone's
>> activity to the user's view, at least CCase does not prohibit that.
GP> I checked with our CC admin, he told me that an activity is for a
GP> user / stream combination, so a different user can't use (read :
GP> checkout in...) another user's activity.
GP>

From the other side - excerpt from my communication with one customer:
--- cut ---
we have scripts that create activities for us but they are still created
by us.
It is possible for activities to be created by root but its unlikely.
--- cut ---

best wishes,
Michael Gerasimov,
Software Developer
JetBrains, Inc


0

I'm not an admin, and don't know all possibilities. Maybe as a administrator, you can create activities and set some user for it, but it's an extremely marginal case. I'm sure the admin would log as the user to do stuff on these activities...

0

I have another scenario to consider.

I have multiple views on multiple streams with a single IntelliJ Project.
The Modules for the project are all located in a single view but each view
has its own IntelliJ cache, thus enabling me to work on muliple views.

Each view will have its own set of activites, all created by me but I only
wish to see the activites for the view I am working on at the moment as
change lists in IntelliJ. This should be possible by adding the -cview flag
to lsact but maybe it should be an option because the way Gilles works he
needs to see all activites across all views
simultaneously.



It would be great if we had some sort of heirachy available in the change
list window but I understand this is outside the core. Then you could group
activites under the view and handle both cases mentioned above.



As for the exisitng comments, I see the same thing as Giles when changing
the active changelist. when I check out a file I expect it to appear under
the active change list. Changing the active change list should reset the
current activity in CC and therefore any subsequent checkouts should appear
under the current activity and corresponding active change list.



Checking in files can be an issue as well unless the move between
changelists is handled correclty, I have had issues beofre where I had moved
a file from change list A (with matching Activity A) to change list B (with
matching activity B), committed change list B but the file was checked in to
Activity A. I have not tried this since the first official release of 7 and
it may have already been addressed.



I agree with not showing the changelist for any obsolete activities, this is
the point of obsoleting the activity, you no longer wish to see it or use
it. And no, do not remove empty change lists as they can be useful, i.e. I
may have a Change list (activity) where I put all my hijacked files (Which
could be empty at some point). These do not have a version associated with
the activity so the activity looks empty.


0

Hello Dave, thanks for providing input :)

>The Modules for the project are all located in a single view but each view
>has its own IntelliJ cache, thus enabling me to work on muliple views.
I don't understand this. Can you describe your setup ? What caches are you talking about ?

>Each view will have its own set of activites, all created by me but I only
>wish to see the activites for the view I am working on at the moment as
>change lists in IntelliJ. This should be possible by adding the -cview flag
>to lsact but maybe it should be an option because the way Gilles works he
>needs to see all activites across all views simultaneously.
I don't mind as long as there is an option...

>t would be great if we had some sort of heirachy available in the change
>list window but I understand this is outside the core. Then you could group
>activites under the view and handle both cases mentioned above.
Yeah, i suggested this as well in my first message to Michael. The problem which can arise is that if you map 2 activities from different views to the same changelist (because they have the same name), then what do you want to see if you ask to group by view ? 2 differents changelists ? Are they the same changelist but under different nodes ? I you commit one, does it commit both ?

>As for the exisitng comments, I see the same thing as Giles when changing
>the active changelist. when I check out a file I expect it to appear under
>the active change list. Changing the active change list should reset the
>current activity in CC and therefore any subsequent checkouts should appear
>under the current activity and corresponding active change list.
Yes, that's a big issue for me right now :) I hate forgetting to change activity in CC explorer.. I can't wait to have IntelliJ doing this correcty.


>Checking in files can be an issue as well unless the move between
>changelists is handled correclty, I have had issues beofre where I had moved
>a file from change list A (with matching Activity A) to change list B (with
>matching activity B), committed change list B but the file was checked in to
>Activity A. I have not tried this since the first official release of 7 and
>it may have already been addressed.
No it doesn't work in #7531, big issue too !!!

>I agree with not showing the changelist for any obsolete activities, this is
>the point of obsoleting the activity, you no longer wish to see it or use
>it. And no, do not remove empty change lists as they can be useful, i.e. I
>may have a Change list (activity) where I put all my hijacked files (Which
>could be empty at some point). These do not have a version associated with
>the activity so the activity looks empty.
Completely agree.

Gilles

0

Basically my setup is that my source code is split into modules, but all
modules belong to one view. Therefore I am only ever working on one view at
a time. However I may have multiple views running concurrently off the same
base code (for patches etc.) and I do not wish to have a separate IntelliJ
project for each view so I store my IntelliJ cache (.IntelliJIdea70/system
directory) inside the view itself. this allows me to point the root to
whichever view I am currently working on without having to rebuild the
cache.

Under this setup I may have multiple activities (same name or not) under
lots of different views, I do not want to see all my activities for all my
views as change lists in IntelliJ as I will only ever be interested in the
activities on the view I am working on.

Clearcase by default 'lsact' will return the activities on the view for the
current context, so to get all activities across all views you would have to
run this command on each view. I have noticed IntelliJ does run 'lsact'
several times on startup so, is it run on each module?? If so that would
explain how you see all your activites across all your views. But in my case
its just time consuming because all my modules are part of the same view. I
have 10 modules so the command is run 10 times and this could cause a
massive unnecessary slowdonwn as it would return the same information each
time.

If this is not the case and IntelliJ has some other way to return all
activities across all views then we need someway to configure this wehter
its an option or a heirachy. The added bonus for the Heirachy view of the
change list window would be that I can at least see which files I had
changed in my other views, this would indeed be very useful.


0

Hello,

I've posted a new JIRA that lists all issues i see after testing latest EAP (build 7549)

http://www.jetbrains.net/jira/browse/IDEA-16326 - properly manage activities

Gilles

0

Was anything more decided on activity Management?

Looking at the latest build it still does not look right. Creating change
lists do not create activities, setting the active change list does not
change the current activity, Checking files out to a change list does not
put them in the correct change list or activity.

I know we have discussed this at length but it seems like nothing was
actually done. Is that the case?


0

Please sign in to leave a comment.