Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Locking in a CVS branch

 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aruneesh,
Try:
cvs adm -lBRANCH_NAME file_name
 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18302
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Aruneesh Salhotra
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 18302
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34973
379
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic