More CVS branches

I'm still finding it difficult to do what I want with CVS branches. There seems to be no very clear way to work in multiple branches of a project at the same time, which seems like it ought to be a basic requirement.

I currently have two branches of my project checked out, head and 1.5. I have two modules defined in my project, one containing each branch. But there seems to be no way to assign a default branch to a module. I also can't assign a default CVS root to a module, which would achieve the same thing.

Generally, IDEA seems to do the right thing, but it's clumsy and it's not clear what it's doing. My specific problems are:

When I check in a file, it doesn't tell me which branch it will check it in to (I have more than once accidentally checked in changes to the wrong branch).

When I check a file's history, it always returns the history for the head branch, even if I explicitly select the 1.5 version.

When I update project, it prompts me for the branch to update from, but clearly it can't update the whole project from one branch. If I update directory on a module, I have to explicitly select the branch to update from.

Am I missing something obvious? How do you guys deal with this? It's an extremely common use case. Should I have a separate project for each branch? That seems like a daft solution, since it's the same project, I want the same settings for both branches.

If there's no easy solution I'll start filing JIRA requests.

12 comments
Comment actions Permalink

Colin Fleming wrote:

I currently have two branches of my project checked out, head and
1.5. I have two modules defined in my project, one containing each
branch. But there seems to be no way to assign a default branch to a
module. I also can't assign a default CVS root to a module, which
would achieve the same thing.


I personally use completely different working copies and project file
for each branch that I work on. I don't think IDEA handles multiple
branches in a single project very well as you've discovered.

When I check in a file, it doesn't tell me which branch it will check
it in to (I have more than once accidentally checked in changes to
the wrong branch).


Using separate working copies will help with this.

When I check a file's history, it always returns the history for
the head branch, even if I explicitly select the 1.5 version.


Actually, I thought it shows the full history including every branch. It
might be a nice option to be able to limit it to the current branch.

When I update project, it prompts me for the branch to update from,
but clearly it can't update the whole project from one branch. If I
update directory on a module, I have to explicitly select the branch
to update from.


Separate working copies again.

Am I missing something obvious? How do you guys deal with this? It's
an extremely common use case. Should I have a separate project for
each branch? That seems like a daft solution, since it's the same
project, I want the same settings for both branches.


Bear in mind that if you store the project .ipr and .iml files in CVS
then this would work better. You would be able to merge changes in the
project files from one branch to another and you would always have the
correct settings in the project for that branch.

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://www.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

0
Comment actions Permalink

I currently have two branches of my project checked out, head and 1.5. I
have two modules defined in my project, one containing each branch. But
there seems to be no way to assign a default branch to a module. I also
can't assign a default CVS root to a module, which would achieve the same
thing.

>

IDEA uses branches info from cvs admin files. There are no setting in IDE

When I check in a file, it doesn't tell me which branch it will check it
in to (I have more than once accidentally checked in changes to the wrong
branch).

>

It will check in each file into current branch for the file (like command
line client does)
If IDEA checked in some files into wrong branch please submit a bug with
"steps to reproduce".

When I check a file's history, it always returns the history for the
head branch, even if I explicitly select the 1.5 version.


Ok, I think there should be a possibility to view current branch only.
Please submit a request

>

When I update project, it prompts me for the branch to update from, but
clearly it can't update the whole project from one branch. If I update
directory on a module, I have to explicitly select the branch to update
from.


Just use "default", it means each directory will be updated from its own
branch specified in cvs subdirectory



0
Comment actions Permalink

Thanks for the tips! I'm starting to think that having separate projects will be the way to go.

Actually, I thought it shows the full history
including every branch.


You may be right, I didn't think so, but I'm not in front of my work PC right now. I'll check later.

Bear in mind that if you store the project .ipr and .iml files in CVS
then this would work better. You would be able to merge changes in the
project files from one branch to another and you would always have the
correct settings in the project for that branch.


So is it easy to merge just a couple of files from one branch to another?

Thanks again,
Colin

0
Comment actions Permalink

It will check in each file into current branch for the file (like command
line client does)
If IDEA checked in some files into wrong branch please submit a bug with
"steps to reproduce".


Ok, it's possible I just did it myself. My main point is that with branches the way it works is extremely unintuitive and not at all clear what it's doing.

Ok, I think there should be a possibility to view current branch only.
Please submit a request


Will do.

Just use "default", it means each directory will be updated from its own
branch specified in cvs subdirectory


Ok, thanks for the clarifications.

0
Comment actions Permalink

Colin Fleming wrote:
>>Bear in mind that if you store the project .ipr and .iml files in CVS
>>then this would work better. You would be able to merge changes in the
>>project files from one branch to another and you would always have the
>>correct settings in the project for that branch.


So is it easy to merge just a couple of files from one branch to another?


It's possible but it makes tracking what has been marged and what hasn't
a nightmare. The problem is that if you merge some files from one branch
to another and then decide later that you want to merge the rest of the
files, you will get conflicts as the same changes are merged in that
first set files again. You can not merge those files or specify a
version after they were initially merged so that you only get changes in
those files since they were last merged. It becomes quite complicated,
especially with per file revision numbres instead of cross-repository.
Generally, you'll want to merge a whole branch at once. Besides, why
merge only the project files if you don't merge the changes in the rest
of the source that I assume required those changes in the project files?

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://www.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

0
Comment actions Permalink

Colin Fleming wrote:
>>It will check in each file into current branch for the file (like command
>>line client does)
>>If IDEA checked in some files into wrong branch please submit a bug with
>>"steps to reproduce".


Ok, it's possible I just did it myself. My main point is that with branches the way it works is extremely unintuitive and not at all clear what it's doing.


What might be helpful is if the Commit Project and Commit Files dialogs
showed the branch to which each file will be committed. Would that be
possible, Olesya?

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://www.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

0
Comment actions Permalink

Possible for commit project/directory.
But in commit file/files dialog where can I place the information to?..

"Gordon Tyler" <gordon.tyler@quest.com> wrote in message
news:dbr2fj$2v0$2@is.intellij.net...

Colin Fleming wrote:

>>>It will check in each file into current branch for the file (like command
>>>line client does)
>>>If IDEA checked in some files into wrong branch please submit a bug with
>>>"steps to reproduce".
>>
>> Ok, it's possible I just did it myself. My main point is that with
>> branches the way it works is extremely unintuitive and not at all clear
>> what it's doing.
>

What might be helpful is if the Commit Project and Commit Files dialogs
showed the branch to which each file will be committed. Would that be
possible, Olesya?

>

Ciao,
Gordon

>

--
Gordon Tyler (Software Developer)
Quest Software <http://www.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001



0
Comment actions Permalink

Olesya Smirnova wrote:

Possible for commit project/directory.
But in commit file/files dialog where can I place the information to?..


Perhaps at the top of the dialog, above the "CVS: After Check In" box?
Something like this:

----



Commit File

----



Branch: HEAD

-CVS: After Check In----



With appropriate spacing, of course.

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://www.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

0
Comment actions Permalink

There can be several files... Print a text message with a branch information
for each file? But if the file is only one - show branch name only, it's a
common use case. Yes, I think it's possible. Please submit a feature
request.

"Gordon Tyler" <gordon.tyler@quest.com> wrote in message
news:dbr67g$lfk$1@is.intellij.net...

Olesya Smirnova wrote:

>> Possible for commit project/directory.
>> But in commit file/files dialog where can I place the information to?..
>

Perhaps at the top of the dialog, above the "CVS: After Check In" box?
Something like this:

>

----------------------------------
| Commit File |
----------------------------------
| Branch: HEAD |
| |
| -CVS: After Check In---------- |

>

With appropriate spacing, of course.

>

Ciao,
Gordon

>

--
Gordon Tyler (Software Developer)
Quest Software <http://www.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001



0
Comment actions Permalink

Olesya Smirnova wrote:

There can be several files... Print a text message with a branch information
for each file? But if the file is only one - show branch name only, it's a
common use case. Yes, I think it's possible. Please submit a feature
request.


That's something I would also like to see: Commit File should show the
list of files that will be committed. If that's done as a list, then
there could be a second column which shows the branch.

http://www.jetbrains.net/jira/browse/IDEA-3904

Ciao,
Gordon

--
Gordon Tyler (Software Developer)
Quest Software <http://www.quest.com/>
260 King Street East, Toronto, Ontario M5A 4L5, Canada
Voice: (416) 933-5046 | Fax: (416) 933-5001

0
Comment actions Permalink

its tricky. we use a decent hack. we use modules + dir strcuture. here's what we do.

1. check out your project into a dir called project-head, project-branchname, etc. this is key beccause if yuo have a file open and it coudl belong to any module, you want to be able to see from the filepath what cvs branhc it is in by looking at its dir name.

so you have

projectdir/project-head/projectname
projectdir/project-branchname/projectname
projectdir/project-branchname2/projectname



2. set up project libraries.
3. use a module for each branch, and of cource call the module "projectName-branchName" .

0
Comment actions Permalink

Wow, go guys, especially Gordon! Sorry, I was away on holiday a couple of days and so missed all this. Feature request duly voted...

0

Please sign in to leave a comment.