如何在签出目录中切换cvs用户

发布于 2024-09-08 00:29:15 字数 179 浏览 17 评论 0原文

我的同事从 cvs 检查了我们的源代码树并进行了一些本地更改,然后给了我整个修改目录的副本。当我尝试对其进行 cvs 操作时,cvs 要求输入他的密码。有没有办法更改此目录中 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

木有鱼丸 2024-09-15 00:29:15

找到了解决方案:

部分描述在这里:
http://worldforge.org/doc/faq/cvs/#unix2

这是什么我做了:

> 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/;"

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/;"
岁月染过的梦 2024-09-15 00:29:15

感谢您的解决方案,斯图帕科夫;它对我帮助很大!使用此命令可以稍微简单一些(并且更通用;我没有安装 perl)。请注意,它同时处理 Root 和 Root.orig:

find module_dir_name -regex ".*CVS/Root\(.orig\)?" -print0 \
    | xargs -0 sed -i s/olduser/newuser/ 

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/ 
二手情话 2024-09-15 00:29:15

TortoiseCVS/CVSNT 的替代方法是使用 switch 命令:右键单击文件资源管理器中的 CVS 跟踪目录,然后从 CVS 子菜单中选择 Switch...。您将收到新 CVSROOT 的提示。例如,如果您的旧 CVSROOT 是“:pserver:alice@cvs:/vol/cvsroot”,请键入“:pserver:bob@cvs:/vol/cvsroot”将用户从 alice 切换到 bob。更改会递归地影响整个子目录。

也可以从命令行执行:

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)

但是,请注意此功能特定于 CVSNT。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文