Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to switch cvs user in checked out directory

Tags:

cvs

My co-worker checked out our source tree from cvs and made some local changes, and then gave me a copy of the entire modified directory. When I try to do cvs operations on it, cvs is asking for his password. Is there a way to change the saved username in the cvs files within this directory so that I can continue working on it as if I had checked it out and made the changes?

We'd prefer not to check in this modified code or create any additional branches.

Thanks.

like image 516
stupakov Avatar asked Jul 02 '10 17:07

stupakov


People also ask

How do I checkout a folder at CVS?

Use “cvs checkout” giving the name of the directory in the cvs repository you want to checkout, where the name you give is a directory under CVSROOT, presently $CD_SOFT/cvs (eg app/alh, script). The directory you give, and all subdirectories, will be placed in your working directory.

How do I checkout a project at CVS?

Click on the left window in the program and select a folder. Then select Cvs Admin - Checkout Module. Select the project folder you created earlier. Enter project module name and click OK.

How do I checkout a tag at CVS?

To retrieve a tagged file or set of files, use the -r tagname option to cvs checkout or cvs update . Use checkout to create a new sandbox, and use update to modify an existing sandbox.

What is CVS command in Linux?

cvs(Concurrent Versions System) command in Linux is used to store the history of a file. Whenever a file gets corrupted or anything goes wrong “cvs” help us to go back to the previous version and restore our file.


2 Answers

Found a solution:

A partial description is here: http://worldforge.org/doc/faq/cvs/#unix2

Here's what I did:

> find module_dir_name -regex .*CVS/Root -print0 | xargs -0 perl -p -i.orig -e "s/olduser/newuser/;"
> find module_dir_name -regex .*CVS/Root.orig -print0 | xargs -0 perl -p -i.orig -e "s/olduser/newuser/;"
like image 179
stupakov Avatar answered Nov 01 '22 15:11

stupakov


Thanks for your solution, stupakov; it helped me a lot!. It can be slightly simpler (and more universal; I didn't have perl installed) with this command. Note that it handles both Root and Root.orig:

find module_dir_name -regex ".*CVS/Root\(.orig\)?" -print0 \
    | xargs -0 sed -i s/olduser/newuser/ 
like image 20
Ethan Bradford Avatar answered Nov 01 '22 15:11

Ethan Bradford