How to switch cvs user in checked out directory
Asked Answered
C

3

5

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.

Chops answered 2/7, 2010 at 17:2 Comment(0)
C
7

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/;"
Chops answered 2/7, 2010 at 17:13 Comment(0)
B
1

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/ 
Belvia answered 1/2, 2017 at 0:48 Comment(0)
A
0

The alternative with TortoiseCVS/CVSNT is to use the switch command: right click on the CVS-tracked directory in File Explorer and choose Switch... from the CVS submenu. You'll get a prompt for a new CVSROOT. For example, if your old CVSROOT is ":pserver:alice@cvs:/vol/cvsroot", type in ":pserver:bob@cvs:/vol/cvsroot" to switch the user from alice to bob. The change affects the whole subdirectory recursively.

Also possible to do from the command line:

PS> cvs switch -h
switch: invalid option -- h
Usage: cvs switch [-f] newroot
        -f      Change all roots, not just those matching the current directory.
(Specify the --help global option for a list of other help options)

However, note that this functionality is specific to CVSNT.

Atthia answered 8/9, 2017 at 9:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.