March 29th, 2012
1:33 pm
CVS error on commit: “added independently by second party”

Posted under CVS
Tags , , , ,

I received this error whilst performing a commit via Eclipse:-

The server reported an error while performing the "cvs add" command. cvs server: xxx added independently by second party

The error related to some test database scripts in the project. I searched for solutions to this, and found some comments about tagging the files as merged, but this was not really any help.

In the end, I examined the files using TortoiseCVS, and noted that the offending files were not flagged as being under source control – they did not have any icon decoration on them.

In the end the following steps solved the problem:-

  1. I made sure I had copies of them elsewhere, and then deleted them from the (TortoiseCVS managed) directory under the eclipse project.
  2. I then did an Update with TortoiseCVS – this reloaded the latest versions from CVS, and this time they were correctly icon-decorated as managed.
  3. I then copied the new versions in to replace these. When I did this, the new versions were correctly decorated in red as updated versions but known to CVS/Tortoise.
  4. I then did a commit with Eclipse, and this now proceeded without error.
  5. Finally to be safe, I did a file compare to check that the correct latest versions were in place.

This solved the problem. It appeared that somehow I had lost the required CVS metadata such that the files did not appear to be CVS managed. Tortoise was very helpful here – if you see files with no icon decoration, this is immediately suspicious.

No Comments »

December 18th, 2009
10:26 pm
Using CVS with Eclipse CVS / TortoiseCVS / CVSNT

Posted under CVS
Tags , , , ,

This post details the installation I use for CVS based source control, together with some usage points and gotchas I came across. My preferred installation consists of the Eclipse CVS plugin and TortoiseCVS on the client side. This gives the flexibility of CVS access both inside and outside Eclipse. In my experience both CVS clients coexist well, and changes in one are immediately  reflected correctly in the other as would be expected. My server side consists of CVSNT running on a separate repository server.

I have broken this tutorial down into linked sub-posts as it was becoming too monolithic and covered multiple topics. The steps are as follows :-

1/ Server Installation using CVSNT

3/ Client Installation, Configuration and usage notes- TortoiseCVS

4/ Client Installation, Configuration and Usage notes – Eclipse CVS Plugin

5/ Branching and Merging in Eclipse CVS and TortoiseCVS

No Comments »

December 18th, 2009
1:46 pm
Branching and Merging in Eclipse CVS and TortoiseCVS

Posted under CVS
Tags , , ,

Branching allows version histories of a CVS module to proceed in parallel, by branching from an earlier version in the repository. This typically arises when a new release is under development in the repository (or has been released) and bug fix changes are needed to an older version without affecting the new release. A branch would be made at the older version and the bug fixes placed on the branch. A client (Eclipse or TortoiseCVS) can pick the branch to work with, and the local files are updated to reflect that branch.

  1. To create a branch in Eclipse, select Team/Branch… from the context menu for the project
  2. To create a branch in TortoiseCVS, select CVS/Branch… from the context menu.
  3. To select a branch in TortoiseCVS, you do an Update Special and pick the branch to switch to.
  4. To select a branch in Eclipse, you do Team/Switch to another branch or version

When Branching, you should normally branch a complete module not just a file. If you just branch a file in eclipse, Eclipse gives you a warning that you are mixing tags within a project. Tortoise does not give you a similar warning however. See here for the internals of branching in CVS. It seems that whilst internally it is done per file due to historical coding reasons, it should ideally be ‘grouped’ as CVS does group files.

If you branch by mistake, you cannot delete it – just leave it unused in the repository.

You can merge changes back into a branch from another branch with both these clients. In both cases, you should have the target branch (which will often be the head) as the current loaded one. You then pick the branch to be merged into it.

  1. To merge a branch into the current branch in Eclipse, use Team/Merge
  2. To merge a branch into the current branch in TortoiseCVS, use CVS/Merge

No Comments »

December 18th, 2009
1:29 pm
Installing, Configuring and Using TortoiseCVS

Posted under CVS
Tags , , , ,

Download and install TortoiseCVS from here. Note that the release notes for version 1.10.10 state that 64-bit versions of Windows are supported. My installation runs fine on Windows 7 64-bit.

Except for the main preferences screen, all of Tortoise CVS is accessed via Windows Explorer context menus. Note that this also works within the file open dialogs of applications.

Connecting to the server is done from the CVS/Checkout… menu. In the left pane of the resulting dialog, you select the protocol, protocol parameters, the server, and the repository folder. In the case of my Java repository above, this will be /Java. Note that you do not need to tell the client the server side path of the repository root.

Tortoise does not cache passwords for access to the CVS server, so you have to enter it for the first time in each session. You can however add custom switches for the connection protocol, which may allow a password to be specified. Note that this is therefore not encrypted! You will probably want a dedicated low privilege account for CVS access if you do this, and in fact this is recommended anyway  – see here for details on how to set this up.

For the pserver protocol, you can add password=mypassword to the Protocol Parameters box in the checkout dialog.
The settings in this dialog are remembered for the next time you use it. If you access multiple replositories, they are remembered and may be selected in the list box at the top.

You do not want Tortoise control on all your explorer folders, as this can slow explorer down and clutter up the context menus when you don’t want it. Use the advanced tab in the preferences dialog to include/exclude folder trees from Tortoise control. Note that if you add a folder tree to include, all others are excluded – see this post here. You can also exclude network shares etc. (done by default).

Usage Points

  1. When checking out, you pick a module name in the RHS pane. You can browse for/refresh the module list first.
  2. After checkout, you get a subfolder for the module tree, which contains a cvs folder which contains metadata and is managed by Tortoise.
  3. If you do a ‘wild’ checkout you will end up checking out CVSROOT which you don’t need – this can be deleted.
  4. You can tag a file or group of files/module etc. to indicate a version, then check this out later using the tag. Note that internally, CVS uses a an “n.n” style internal version number starting at “1.1” for a file.

No Comments »