tags:

views:

1112

answers:

2

If you've named a branch in CVS incorrectly, or the name originally chosen becomes inappropriate, how do you change it to something else?

A related question is How do you rename a branch in CVS without admin access?.

+3  A: 

The trick to this is using one of CVSs' more obscure admin commands, -N. It is a two stage process, effectively copy then remove.

Firstly, you create a branch with the correct name that references the original branch name. Secondly, you delete the original branch name.

Assume you have a file "File.txt" that is currently branched "bad_branch". You'd like the branch to be called - can you guess? - "good_branch".

kwutchak% cvs log File.txt

RCS file: .../data/File.txt,v
head: 1.1
branch:
symbolic names:
bad_branch: 1.1.0.2

To create the new branch reference:

cvs admin -N good_branch:bad_branch File.txt

kwutchak% cvs log File.txt

RCS file: .../data/File.txt,v
Working file: File.txt
head: 1.1
branch:
symbolic names:
good_branch: 1.1.0.2
bad_branch: 1.1.0.2

To delete the original reference:

cvs admin -N bad_branch File.txt

kwutchak% cvs log File.txt

RCS file: .../data/File.txt,v
Working file: File.txt
head: 1.1
branch:
symbolic names:
good_branch: 1.1.0.2

kwutchak
Please excuse me for accepting my own answer - I'm using StackOverflow as a record so that I don't need to research this again in future...
kwutchak
A: 

What if you do not have admin access to the repo?

I've made a new question for this:A related question is [How do you rename a branch in CVS without admin access?](http://stackoverflow.com/questions/1299015/how-do-you-rename-a-branch-in-cvs-without-admin-access)
kwutchak