2011-09-08 92 views
10

我想提交我的修改CVS仓库时如何解决的问题,但我得到了以下错误:提交更改CVS

RCS file: /opt/CZarmen/CVS_REPOSITORY/Z_user/lib/python/StudioCustom.py,v 
retrieving revision 1.38 
retrieving revision 1.39 
Merging differences between 1.38 and 1.39 into StudioCustom.py 
M lib/python/StudioCustom.py 

RCS file: /opt/CZarmen/CVS_REPOSITORY/Z_user/menu_scripts/Y/ZExtensions,v 
retrieving revision 1.46 
retrieving revision 1.47 
Merging differences between 1.46 and 1.47 into ZExtensions 
M menu_scripts/Y/ZExtensions 

cvs commit: Up-to-date check failed for `lib/python/StudioCustom.py' 
cvs commit: Up-to-date check failed for `menu_scripts/Y/ZExtensions' 
cvs [commit aborted]: correct above errors first! 

为什么它无法提交我的变化?我如何“纠正上述错误”?

回答

17

您需要先更新您的工作副本,方法是运行cvs up,因为有人在处理这些文件时已经更新了这些文件。在提交期间,CVS不能自动合并这些更改。

+1

但是,如果我更新我的工作副本,我将失去我的编辑,不是吗?我的意思是说,该文件包含“abc”,我想使它成为“abcd”,但有人已经更新为“abce”。如果我更新我的工作副本,我的文件将会“abce”,并且“abcd”将会丢失,对吗? – alwbtc

+0

而且,哪一个是“工作副本”? CVS存储中的一个,还是我本地计算机中的那个? – alwbtc

+1

工作副本是您想要执行'cvs commit'调用的目录。服务器部分被称为存储库。 'cvs update'不会覆盖你的改变(除非你通过'-C'标志),但如果你担心你可以先执行'cvs diff> myChanges.patch'来将修改保存在一个补丁中。 – DarkDust

1

此外,以防万一您有时可能会错误更新您的本地版本。最终的解决方案是:

1. Save your local code to another place manually

2. Revert the files which may has conflict to the HEAD (most latest) version on CVS server.

3. Add back your change to the Reverted file.

对上述方案的概念是从REVERT库清理所有可能的问题,并获得了100%的干净版本,则加回我们的变化。

它可以解决以下问题,这些问题是由代码过期/代码库造成的。

  1. CVS commit had a conflict and has not been modified
  2. CVS update failed
  3. CVS not sync