【问题标题】:How to switch cvs user in checked out directory如何在签出目录中切换 cvs 用户
【发布时间】:2010-07-02 17:02:31
【问题描述】:

我的同事从 cvs 中检查了我们的源代码树并进行了一些本地更改,然后给了我整个修改目录的副本。当我尝试对其进行 cvs 操作时,cvs 正在询问他的密码。有没有办法更改此目录中 cvs 文件中保存的用户名,以便我可以继续处理它,就好像我已经检查并进行了更改一样?

我们不希望签入此修改后的代码或创建任何其他分支。

谢谢。

【问题讨论】:

    标签: cvs


    【解决方案1】:

    找到解决办法:

    这里有部分描述: 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/;"
    

    【讨论】:

      【解决方案2】:

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

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

      【讨论】:

        【解决方案3】:

        使用 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 特有的。

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 1970-01-01
          • 2019-09-10
          • 1970-01-01
          • 1970-01-01
          相关资源
          最近更新 更多