aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Locking in a CVS branch Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Locking in a CVS branch" Watch "Locking in a CVS branch" New topic
Author

Locking in a CVS branch

Aruneesh Salhotra
Ranch Hand

Joined: May 12, 2004
Posts: 167
Hi,

I read about CVS locks, by creating #cvs.lock file in the repository.
I wanted to know if there is a way to lock a release branch only, and have the HEAD in operation.
Regards
Aruneesh
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30780
    
157

Aruneesh,
Try:
cvs adm -lBRANCH_NAME file_name


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Aruneesh Salhotra
Ranch Hand

Joined: May 12, 2004
Posts: 167
I want to try this on the branch, so that for a while the branch is locked.

What would be the way to unclock the branch.

By the way, the cvs -adm ...., can this be applied to module instead of going file by file.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

CVS doesn't lock files against concurrent editing the way systems like PVCS does. I believe that the cvs lockfile is used merely for the purpose of ensuring that when you pull updates, you don't get data from an update that someone else is actively checking into cvs.

If two people edit the same file at the same time and it was checked out of CVS, a conflict will be indicated when the second user attempts to check his/her updates in after the first user checked in updates. The second user must then perform a merge operation to resolve the conflicts before beling allowed to check in.

The reason that CVS doesn't permit you to lock files against being updated is because CVS was designed to be used in a widely-distributed environment where users worked in on differing schedules and might drop work on a project altogether without notice.


Customer surveys are for companies who didn't pay proper attention to begin with.
Aruneesh Salhotra
Ranch Hand

Joined: May 12, 2004
Posts: 167
Tim,
You misunderstood my question/query.
I want to lock a branch (a release branch) from code being checked into.

But developers, should be able to checkin code in the HEAD.
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16145
    
  21

Sorry.

I don't think you can seal off a branch like that, though out of the box. CVS is predicated on not having a single master administrator who can dictate what others can or cannot do. Other than simply limiting who can commit at all, so bad guys can't come in and pollute.

You might be able to create/find a filter that rejects commits and tie it to some sort of database, though.
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30780
    
157

Originally posted by Aruneesh Salhotra:
Tim,
You misunderstood my question/query.
I want to lock a branch (a release branch) from code being checked into.

But developers, should be able to checkin code in the HEAD.

We delete all the files from the tip of the branch. This prevents accidental releases to it. After that, it is the honor system. If someone releases code to the branch again, you can just see which id did it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Locking in a CVS branch